Topic was automatically imported from the old Question2Answer platform.
Asked By
lalel345
i have this code for use get_simple_path()
extends KinematicBody
onready var player = get_node("KinematicBody2")
onready var nav = get_parent()
var path = nav.get_simple_path(self.translation,player.global_transform.origin)
func _ready():
pass
func _physics_process(delta):
path = nav.get_simple_path(global_transform.origin,player.global_transform.origin)
move_and_slide(path,Vector3.UP)
What am I doing wrong and what should I do?
Maybe it has something to do with the first parameter in the method nav.get_simple_path(self.translation,player.global_transform.origin)? Maybe the first parameter should be global_transform.origin?
I only done 3d navigation once awhile ago but looking at my project you need to calculate the vector to the next point of the path. Here’s just a quick copy and paste
Edit: Sorry I’m a little dumb drop that, here’s a tutorial https://www.youtube.com/watch?v=_urHlep2P84 then one issue I ran into is that I accidentally rotated the navigation node and I was having weird effects.