How do I detect that is behind an object to another.

Get help using Construct 2

Post » Fri Jul 31, 2015 1:48 am

Unity of looks like this:
Code: Select all
// detects if other transform is behind this object
     var other : Transform;
     function Update() {
         if (other) {
             var forward = transform.TransformDirection(Vector3.forward);
             var toOther = other.position - transform.position;
             if (Vector3.Dot(forward,toOther) < 0)
                 print ("The other transform is behind me!");
         }
     }

This is how to do it in Construct program?
B
14
S
2
Posts: 66
Reputation: 776

Return to How do I....?

Who is online

Users browsing this forum: el3um4s, TylerJS and 9 guests