Chcę żeby StaticMesh w klasie Attachment mojej broni, kręcił się wokół własnej osi.
Próbowałem już wiele sposobów i używałem setki funkcji (UpdatePawnAttachment(), UpdateRotation(), SetRelativeRotation(), SetRotation(), itp. ), i nadal to cholerstwo nie działa.
Chciałem to kontrolować jedną funkcją w klasie MyWeapon.uc mojej broni:
Kod: Zaznacz cały
function Tick(float DeltaTime)
{
local float deltaRotation;
local Rotator newRotation;
local string rotLog;
deltaRotation = SvelRotation * DeltaTime;
newRotation = Rotation;
newRotation.Pitch += deltaRotation;
newRotation.Yaw += deltaRotation;
newRotation.Roll += deltaRotation;
//if(sAttachment!=None)
//{
// sAttachment.bIgnoreBaseRotation=true; // Does not working
sAttachment.SetRelativeRotation(newRotation);
sAttachment.UpdatePawnAttachment(false);
//}
// For testing is function working good
rotLog = sAttachment.RelativeRotation.Roll@sAttachment.RelativeRotation.Yaw@sAttachment.RelativeRotation.Pitch;
Instigator.ClientMessage("Rotation: "@rotLog);
}
Zna ktoś jakiś sposób, żeby obracać StaticMesh z klasy Attachment wokół własnej osi?