how to make the object move faster than the player?

thats the code i have but no matter what the object always keeps distance for some reason


image

To keep it in front of player, you’ll need to multiply the forward vector by some float before adding to location. Interp speed will likely need to be faster as well. On the begin overlap event you could set a looping timer bound to an event which checks player velocity and sets the floaty thing’s max speed to that divided by something.

2 Likes

this could be a case for “Tick Groups” where by default objects go into the Pre-Physics_Tick_Group unless otherwise set. (this is so that if the object is moved say into a wall or other solid object during the its Tick() the physics collision response can take care of it)

there is an “order” to what objects get called when the engine iterates over the Tick-Group, but that order is only maintained until items start getting spawned, killed, or Garbage Collected, and so on; effectively you should consider the order of the Objects being called to be effectively random.

so in the event that the Floating Objects Tick() stuff happens before the player then the player “should” get closer, but when the Floating Objects Tick() happens after the player’s it should gain distance. if you want the floating object to update its position based on where the player IS not sometimes where it is, and where is WAS then you might want to move it into maybe “During Physics” or “Post Physics”. it is also a good idea to use multiple tick groups to cut down on lag spikes.

in conjunction with above 1 and 2 are very small numbers for velocity (you might want to check your BP_PlayerCharacter on what its max speed is set too I think most of the templates have this at like 100+ or so)

1 Like