Hi, I have a simple move to function that works well. It takes in a controller, moves to the player’s starting position and is activated with a timer. That all works fine except I’m making a space game so I want things to fly at me from all directions. However simple move to seems to work assuming actors walk to a given place. So in order to move objects I need to have a plain or something in the game. What is the easiest way to have things move as if they were flying instead of walking?
Can I bump this? I’m sure the solution is very simple but I can’t seem to find it anywhere.
Here:
If you put this in any blueprint, it will smoothly follow / chase the target. In this case, the target is a player pawn.
Lerp linear interpolates between two points, in this case this blueprint’s position and player’s position. If you want to move it slower/faster, just multiply “Delta Seconds” by your speed variable.
EDIT: Updated version, with speed variable. It will also rotate towards it’s target:
However i don’t know how to eliminate this deceleration when it’s close to target…
Thanks a million. That works perfectly. A little more complicated then I was expecting the solution to be but still more than easy to grasp. Few last question, the X logic brick you use to take in the speed and delta second, what is that called? And does this have to be done with an event tick? I was advised to use a timer instead of an event tick as I plan to have multiple objects heading towards the player and it may slow the frame rate.
The X brick is a Multiply node. You can get it by pressing right mouse button and typing “multiply” or just “*”. If you have behavior like gun rapid shooting / etc. it’s better to use timer or loop with delay, for example:
But for movement - Event Tick is every frame and it allows to smooth transform transitions, the more delay you set in timer/delay node the less smooth it will be. But maybe there is another method for smooth movement without using Event Tick, i don’t know.
Ah multiply. That makes a ridiculous amount of sense. I should have been able to work that out myself. Never mind about the timer. If it does become a problem I’ll deal with it in the future. I think I’m all set now. Thanks again. You’ve really helped me out.