Announcement

Collapse
No announcement yet.

How can I reset my player rotation correctly ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I reset my player rotation correctly ?

    Hi there,

    Here is my problem : I'm trying to build a cover system from the TwinStick Shooter tutorial epic provide. The fact is that my character is rotating when he's getting in cover, but it can't reset to the normal rotation, even if I sore a variable with the default rotation at the moment the game is playing.

    The process to do that : I'm launching a trace, that return me the cover the character will use. Then, I get the rotation of this cover, and make a Lerp(rotator) to have a smooth transition between the default rotation and the cover's rotation, so that the character has the same rotation. And finally, when I'm leaving the cover, I'm trying to reset the character rotation to the "Default" one. But... its not working at all.

    Here are some screenshots of the game and the Blueprint I'm using to do this :

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	88.3 KB
ID:	1166404

    Click image for larger version

Name:	Capture2.JPG
Views:	1
Size:	70.6 KB
ID:	1166405

    Click image for larger version

Name:	Capture3.JPG
Views:	1
Size:	69.9 KB
ID:	1166406

    Click image for larger version

Name:	UE4Editor 2015-11-05 12-07-56-22.jpg
Views:	1
Size:	209.4 KB
ID:	1166407

    Click image for larger version

Name:	UE4Editor 2015-11-05 12-08-01-20.jpg
Views:	1
Size:	216.0 KB
ID:	1166408

    Click image for larger version

Name:	UE4Editor 2015-11-05 12-08-04-51.jpg
Views:	1
Size:	215.9 KB
ID:	1166409

    Click image for larger version

Name:	UE4Editor 2015-11-05 12-08-09-64.jpg
Views:	1
Size:	216.0 KB
ID:	1166410

    Click image for larger version

Name:	UE4Editor 2015-11-05 12-10-44-87.jpg
Views:	1
Size:	47.6 KB
ID:	1166411


    Sorry for the long post ...
    Thx,

    Dusaral

    #2
    If you use AI for driving your pawn you should try: "Set Focus", "Clear Focus", "Get Focal Point".
    I decided to add pawn AI (and give it direct basic orders) as middle man for controlling pawn, all problems of transitioning between anims, adding idle etc are already solved by Epic. Driving player pawn trough AI is so much less messy.

    Comment


      #3
      Well I think I've found another solution.
      The problem seems to come from the fact that I was storing my Default Rotation variable from the event begin play ... Which wasn't really stored !
      Since the moment I moved the setting of this variable to an input fired, it worked ...

      Anyway, Thx Nawrot

      Comment

      Working...
      X