0 votes

Hello, sorry for dummy question but cannot figure out why it does not work.

So I have RayCast2D, where I take collision point via:

teleport_dest = ray.get_collision_point()

Then I am trying to move my player to this point with code:

var x = move_toward(position.x, teleport_dest.x, delta)
var y = move_toward(position.y, teleport_dest.y, delta)
move_and_slide(Vector2(x, y))

But it move player complitly do different way. What I am doing in wrong way?

asked Mar 30 in Engine by Edgar Vakhitov (14 points)

I'm pretty new to Godot as well so I don't know if this will help, but I do know that in Godot, up is the negative y direction, and down is the positive y direction. So maybe you just need to add some negatives to make it go the other way.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.