Quantcast
Channel: Answers for "Check that an object is within the bounds of a trigger, but not touching them?"
Browsing all 5 articles
Browse latest View live

Answer by sparkzbarca

oh this is very easy just do a distance check. assuming you have for example (the easiest one) a sphere trigger. If (vector3.distance(sphereTrigger.transform.position, player.transform.position) >...

View Article



Answer by BSelvar

I would use OnTriggerStay and a boolean variable that becomes true when the Player is within the object and then set that boolean to false with OnTriggerExit. Then I would apply effects to the Player...

View Article

Answer by sparkzbarca

oh this is very easy just do a distance check. assuming you have for example (the easiest one) a sphere trigger. If (vector3.distance(sphereTrigger.transform.position, player.transform.position) >...

View Article

Answer by BSelvar

I would use OnTriggerStay and a boolean variable that becomes true when the Player is within the object and then set that boolean to false with OnTriggerExit. Then I would apply effects to the Player...

View Article

Answer by CubeFlix

You can make invisible bounds, like with the Physics.OverlapSphere(), using it like this: void Update(){ Collider[] thingsInBounds = Physics.OverlapSphere(transform.position, radiusOfBounds);...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images