0 votes

I'm trying some prototyping for my project....3d- point and click action adventure from like helicopter cam. view.
I need a player position right? :
player_pos = get_node("player").get_translation().normalized
then....mouse click position but how?
var mouse_click = get_viewport().get_mouse_pos() ??? # I get null-null error
and finally player destination

var destination =  player_pos.origin - mouse_click ???


if Input.is_action_pressed("mouse_click"):
   destination = destination.normalized() * delta * walk_speed

....all this on the KinematicBody script
and there is a rotation....better player facing when he start travel to mouse click position too.
So ,....thanks for every help,guys.

in Engine by (450 points)
edited by

I recommend watch the example of point and click.
You get more easier your achievement if you use a Navigator node.

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.