Hello, I tried searching for this answer on the hub and didn’t have any luck, was wondering if any of you guys would be able to help me out. I’m new here and was following the programming quick start guide and got to the part which asks you to:
Add periodic motion on the X and/or Y axis, and multiply the DeltaTime value by a number between 0.6 and 1.4, so your FloatingActor appears to float around freely. This can look great for powerups!
Was wondering if anyone could tell me how that would like in code.?
How could I make the floating actor seem a little more randomly floating in the air, rather than floating from one end of a diagonal to another? Was playing around with the rand() function, wasn’t sure if that was the right one to use. Any help is appreciated, thanks.
What if I don’t want to use FMath::RandRange? I want to multiply DeltaTime just like it’s saying in the QuickStart tutorial (5 step), but I already tried everything. The question is: where must I multiply the DeltaTime?
Basicly You need to know that to make good looking natural hoovering obove the ground is not so simple task and it can be a little to early for You
using a curve seems to be good idea, but the downvote for it is that it will float always in the same path. Using behaviour tree for something such simple as hoovering powerup is a bit overkill IMHO.
The way it shoul be truly done is to use noise. Noise is a algorithm that gives You numbers that are random but each subsequent is connected with previous and similiar to it so it is good to animate position. Google “Perlin Noise”.
Well, even though noise gives you nice randomness, I think this is overkill as well. It is just a visual effect. Noise is pretty slow to lookup every frame.
You could just add another curve for rotation and/or make a curve that handles several periods with some variations. Nobody will ever see a pattern if Rotation and Translation have different period times.