Collision of objects with world camera
Tried to collide two objects, works great until i put the camera with world tracking.
idea was to attach a object to the camera so as it moves it could dodge the object if needed.
but I feel this is messing up with the 3d space due to the camera been world
// -----JS CODE-----
// @input SceneObject objectA
// @input float collideDistance = 0.25
// @input SceneObject objectB
var objA = script.objectA.getTransform().getWorldPosition();
var objB = script.objectB.getTransform().getWorldPosition();
var distance = Math.abs( objA.distance(objB));
if( distance <= script.collideDistance ) {
print( "COLLIDE!" );
script.objectA.enabled = false;
}
else
{
}
Hey Patrick! I tested your script and it works fine for me when world tracking was enabled. Here are a few things though that I had to do to make it work:
Hope something here points you in the right direction!
Can you guys some me how this is done in a gif? I have been playing around with the AABB detection with no success.