Putting back an actor to its original position GRADUALLY after end of animation.

Hello,

I am trying to do a floating platform that reacts to the implicit “weight” of the character. Basically trying to simulate fairy tales physics. (Using blue prints, but something tells me this requires c++, although I hope it doesn’t)

I have this mechanics in my mind, where the character overlaps a collision box and begins to animate a component on its Z axis in a sine wave manner, indefinitely until I step out of the box.

I managed to do that, but when I step out of the collision box, the component updates its Z position and even worse, the animation starts again back where I am telling the Timeline node the Z value is.

It would be cool if the platform takes its current Z position at the moment the character steps out of the box, and from there convert the Z position back to its original position through a sine wave that gradually reduces its amplitude.

Also, the Z value should hit a threshold where the gradually reducing sine wave stops reducing and just completes its 360 degrees phase.

I lack the power to demand this to my computer. Please help me communicate with my computer!

Thank you in advance

Isn’t this key here? Why not simulate physics?

Can the engine do that automatically without any code or blueprint with an on and off switch? Is it that what you mean?

You need to script it, of course. Is this close enough:

3 Likes

Not close enough, EXACTLY what I have in mind.

May I see the script?

Thank you!

Disclaimer: this a mundane implementation of a basic dampened spring (can be made better):


Also, you could use Physics Constraint component instead:

No script is needed here and you’d get more control. Or use the new Physics Control plugin.

1 Like

I’ll have a look and let you know cheers!

What variable type is the variable Spring state?

Right click the pin on the node and Promote to Variable → works with any pin in the engine. Also, you can hover over any pin to find out the type.

Nothing.

I guess what I have in mind is to advance for my level of knowledge, so I will move on and make simpler stuff.

Thank you, I learned still A LOT of things while trying this.