Rotation Deobfuscation?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

dataangel

New Member
Apr 11, 2004
184
0
0
Sometimes in my mod I want my pawn's rotation to not be affected by the player's view (this is a 3rd person mod), and other times I want it to be. This is proving to be alot more difficult than it should be.

The only way I can change rotation is by either direct calls to SetRotation or calling Controller.SetViewRotation. I can't get DesiredRotation to work at all.

Changing the Yaw to be += 16384 (90 degrees) with Controller.SetViewRotation() rotates the view and the pawn, as I would expect. But changing the Roll just resets the view to the default, and changing the pitch always makes the camera go right under the pawn looking straight up at his crotch (even with LimitPitch overridden).

Why don't xPawns seem to respond to DesiredRotation? The description in Actor.uc says that the physics will automatically rotate the actor to DesiredRotation, but this doesn't happen. At first I thought this was because I wasn't rotating the controller, but setting the controller DesiredRotation to the same value at the same time still does not work. bRotateToDesired is true for both pawn and controller. Setting bSetTurnRot for the controller to true doesn't work either.

Another theory -- since it seems DesiredRotation is applied in native physics code, I thought maybe pawn's were specially exempted. But if you look in xPawn.uc there's a function called RandSpin() defined that uses DesiredRotation -- although calling it does nothing. It's also not called in any of xPawn's subclasses. I thought maybe it would be called in native code for ragdolls -- but why do that when all the other ragdoll stuff is in script? :p

More checking -- no states defined in pawn.uc, xpawn.uc, controller.uc, playercontroller.uc, or xplayer.uc ignore DesiredRotation.

At this point it looks like the only way to get my own smooth rotation is by calling SetRotation by the tick -- which would be a pain, and would have to take into account stuff like one desired rotation one tick and a different one the next tick :p

Any ideas on how to get DesiredRotation to work for pawns? Or a simpler way to get smooth rotation?

P.S. I'm testing all of this by using an exec function and binding a key to it. And yes I've used logs to make sure it's running =)
 
Last edited:

Orione

New Member
Nov 15, 2004
31
0
0
I know this message is a quite old, but solution can anyway be useful to someone else at least:

from the wiki:
PHYS_Rotating
Only rotation changes. Location doesn't change. If bRotateToDesired is false, then the Actor rotates according to RotationRate. If bRotateToDesired is true, then the Actor rotates to the rotation specified by DesiredRotation at the speed specified by RotationRate.

So to make Actors to rotate to DesiredRotation you have not only to set bRotateToDesired to true, but also to set a RotationRate value
 

Orione

New Member
Nov 15, 2004
31
0
0
Actually I'm stucked on event EndedRotation():
From the wiki: Called when an actor's rotation has reached DesiredRotation?

I'd want to move an Actor just as it finishes to rotate, but it seems not to enter this event body.

an alternative solution could be to check every 0.1 seconds if rotation is completed, comparing actual Actor's rotation and target one, but I'd prefer to use the event.

So if anyone could make more light in this topic hints are well accepted.
Orione
 

Orione

New Member
Nov 15, 2004
31
0
0
EndedRotation() is a probe function, so it can be Enabled/Disabled
So I tried to Enable('EndedRotation'), but it still seems not to be executed even if my Actor stops rotating when it reaches the correct direction