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?
Posts: 75
Reputation: 844

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests