I've read iTween is good for this but the only one i can find is to move it. I want my character to move say a boulder out of the way by pushing it, but only to a certain point? Like say the character pushes the boulder to the end point which then triggers an event of some kind because it's on top of a switch maybe? Just to give an example?
I'm not asking for like the whole move and push to an event just how to move say a boulder to a certain point that it stops moving?
Um, a way to go about this...
Give the "boulder" a rigid body... And then add a collider that's attatched to it, so that when you move it, it only moves because of the physics, and stops when it hits the collider... Could be easy...
Alt: You can animate this... if player goes to spot A, and pushes F, then boulder rotates and moves ->>> if that makes sense.
answered Apr 07 '11 at 04:01 PM
You can use a distance check.
You need a few varaibles:
Vector3 targetPoint - The target in world space.
float actionDistance - How far the boulder needs to be from targetPoint before triggering the action. If you want the boulder to have to be in a specific spot set this equal to the boulder's radius
float radius - The radius of the boulder.
Here is some code
answered Apr 07 '11 at 08:31 PM