Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ohjlljljlhlh.ijijojoijojoj's avatar
5 months ago

Disabling hand grabbed object when entering a region

I have a 3D game object, Player that is grabbed and moved by hand or controller (ISDK). When it enters a specific game object,  RestrictedZone, it should freeze not to move in. Movement of hand or controller should not cause the object to enter. But can be taken out of this region and moved. I tried several ways nothing worked as it’s grabbed and moved with button  press. 
any help is appreciated. 

1 Reply

Replies have been turned off for this discussion
  • "Not to move in". Maybe make an object (Say a Cube,) make it the size of this region. Make sure it has a collider. Then disable its mesh renderer. Now you have a region that is invisible that the player can not enter.

    Or if you mean the player is put into a no-move region until some action is taken.  Set a flag when you do not want them to move, then unset it when you want them to move again.

    void OnMove(...) { if (OkToMove)  norman-move-stuff else ... }

    I do the same thing with important pop-up or menus. When they pop up, I disable move until they  answer the question, cancel, or whatever I want done.