|
im creating a very simple scene in unity where u pick up a cube and place it on a button to make a bridge appear. i know almost nothing about scripting and am still very new to all of this so any information is helpful. i need the bridge to only activate when the cube has been placed on top of the button. and when the cube has been removed, the bridge needs to disappear. i can make the button activate when anything touches it with the activate trigger script but i want it to only activate on and off when the cube is touching it... any help would be great
(comments are locked)
|
|
You will want to specify the object by either using a tag comparison or name comparison. Below is an example using tag(since if you clone the cube its name will go from "Cube" to "Cube(Clone)" thus preventing the code from continuing..
(comments are locked)
|
|
Not 100% sure if it works... but I'm thinking it will. Adjust the timer to 0.1 if you want instant release, if not.... Poof. You've got a timer.
(comments are locked)
|
