#Pulling your character to an object

1 messages · Page 1 of 1 (latest)

atomic arch
#

a normalized vector 2 has a length of one, which means you're adding a total velocity of one to the character

late gyro
atomic arch
#

try setting the velocity to something like global_position.direction_to(string_pos) * global_position.distance_to(string_pos

#

probably not exact syntax i forgot what the method names are

#

(i think direction to returns a normalized vector i dunno lol)

#

and also you probably wanna use the strings' global position instead of local position just in case

late gyro
#

Okay, I’m about to eat dinner but afterwards I’ll let you know

atomic arch
#

alr

late gyro
#

It works great, thank you!

atomic arch
#

just make sure you understand why it works

late gyro
#

Yeah

#

No, I see. I just didn’t know distance to and direction to existed

#

Actually, one last thing. If I add delta to it. It only applies vertical movement for some reason

atomic arch