How to rotate a child object smoothly while key is released? (without Event Tick)

Hello, I’m trying to create a character which can rotate smoothly his part of body in y-axis to limited angle while shift key is pressed and it does but when it comes to make the part go back then the part rotates around its axis or just teleport to 0 degree as it is in Set Relative Rotation , I tried lots of ways to achieve my desired effect since 2 days but no one of them works. I would send my blueprint screen here but there is nothing to watch as i delete my tries each time it fails xD.

try this:

or interpto but that has code on event tick

1 Like

Ok, I did it using collider as a child object, “OnComponentBeginOverlap” and “Add Local Rotation” but I’m still thinking there must be some more efficient solution. Anyway thanks Nawrot for helping.

Yes there is:

(check also other interpto vids from him, and pick one you like most)

For your problem:

  • use aim offsets in animation blueprint
  • to slowly rotate use Finterpto , set its speed etc.
    now code part:
  • create variable: desired_rotation
  • use that var in Finterpto as target
  • then when you press button set target to one value
  • when you release set it to value for released rotation (or for aim offset anim)

This way you will have two animation “poses” for pressed and released key, and it will smoothly interpolate.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.