Oh thanks I forgot to mention it. That's the first thing I checked. My Objects are working correctly in the exemple scene, but the exemple objects are not working on my ship. I looked at the code moving the "Spacechip" in the exemple and it looks like the ship is being moved in FixedUpdate by manually changing its transform :
void Start()
{
// The ship is moved in the manager's OnPrePhysicalUpdate callback, which ensures
// (1) the ship's transform is updated before the Interaction Manager runs, and
// (2) the ship's transform is updated in FixedUpdate.
//
// The Interaction Manager takes into account how it has moved since its last
// update, and informs interaction controllers appropriately, allowing
// interfaces to function properly.
InteractionManager.instance.OnPrePhysicalUpdate += updateShipPhysics;
}
private void updateShipPhysics() {
// Update velocity.
Vector3 acceleration = _accumulatedForce / _mass;
_velocity += acceleration * Time.deltaTime;
_accumulatedForce = Vector3.zero;
// Update position.
Vector3 newPosition = this.transform.position + _velocity * Time.deltaTime;
this.transform.position = newPosition;
// Update angular velocity.
Vector3 eulerAcceleration = _accumulatedTorque;
_angularVelocity += eulerAcceleration * Time.deltaTime;
_accumulatedTorque = Vector3.zero;
// Update rotation.
Quaternion newRotation = Quaternion.Euler(_angularVelocity * Time.deltaTime) * this.transform.rotation;
this.transform.rotation = newRotation;
}
If I understood correctly, all the physics in Unity are calculated and done AFTER FixedUpdate, so, since the transform needs to be changed BEFORE and my ship is completely moved by physic, the Interaction buttons don't work properly. In my scene, the colliders are indeed "behind" their renderer.
I am somewhat of a beginner with Unity so i could have missed something or read something wrong and I really want someone to tell me that I'm wrong or that there is a way to use the Interaction kit on moving objects.
Thank you.