Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | eiko |
My immediate problem is that I have a KinematicBody designed to “lock on” to a target’s location by moving there as fast as possible. This code works perfectly in a little demo with two meshes; however, when I set the target to an ARVRController, the KinematicBody running this code zooms really far away instead of moving toward the controller.
extends KinematicBody
var target
export(NodePath) var target_path
func _ready():
target = get_node(target_path)
func _physics_process(delta):
var direction = target.global_transform.origin - global_transform.origin
move_and_collide(direction)
The problem at large that I’ve been trying to solve is that I need both my player and my controllers to have KinematicBodies so they can interact with the world. However, ARVR expects ARVRController to be nested within ARVROrigin, but collisions don’t work properly if the KinematicBodies are nested
I would be happy if you could either explain why my code sample doesn’t work with an ARVRController target, or if you could explain how to have kinematic bodies for the ARVROrigin and ARVRControllers without breaking the nesting that ARVR expects