So I just want to recreate a simple animation from Mario. When Mario collides with a question block from underneath, it moves up and down and spawns a coin or enemy.
I’m using a timeline but it seems unnecessarily convoluted and messy for such a simple looking effect.
I’m using a float track with a duration of 0.25 seconds from values 0 to 1. Then I lerp the position up on the z axis and back down again.
The animation works but am I using the timeline correctly? Also; is there a better, more “standard” way of accomplishing this?
not sure if relevant to flip books (cant imagine it’s any different tbh), but the easiest way to use a timeline is to have your values between 0-1 over whatever time you want, and then on the “alpha” pin multiply it by your “distance amount” and plug that in to a “make vector” node in the axis you wish to move then plug that into a “+” node the plug that into the set world location node. and then if you want it to reverse, then pull the “completed” pin from the timeline and plug into the “reverse from end” pin of the timeline. make sure to make your “distance amount” variable instance editable to make testing easier and will give you the ability to change each individual cubes movement amount if you wish.
Clockwork means to save your starting WorldLocation to a variable before calling the timeline, otherwise it’ll change on update since its a pure function
Put the vectors you intend to lerp between into variables, and use those variables in the timeline. The way you’re doing it, you’re sampling things that are changing while you’re trying to read them.
Hi Cestarian. I did actually try something along those lines before my current solution. I turned on physics and gravity but the block wouldn’t budge. I obviously did something wrong. However; this would be my preferred method so I will give it another try.
The block not moving with physics on is obviously a problem you’ll have to solve at some point so that’d be a good idea, a common issue I had in 3D was that if a mesh didn’t have a proper collision setup it would not move.
E.g. a skeletal mesh without a physics asset would have physics not working for instance.
It could be something like that that’s causing your issue.