Is this possible to script?
Hello,
I've very new to Unity and I'm trying to get some pointers on where to go if I'm trying to make a trigger interaction with Boolean. Is it possible to script this idea that I'm having? I have two pressure plates and once items are resting on the two pressure plates the player can then interact with a lever to have the door open up? Any assistance would be greatly appreciated.
Yes it is, you need to look up the scripting tutorials first.
You already know you need a trigger so OnTriggerEnter would be a good place to start. Get that to set a bool to true for your plate and OnTriggerExit set it to false.
Then when you click on the lever get a script to check the bool state on each plates script. Just do a search for accessing a variable in another script, you'll find lots of results. YouTube and google are your friends as well. Unity has an amazing user base that do 1000s of tutorials each year. You're almost always faster searching for an example than asking here but if you get stuck with a script come and ask for assistance and post your script.
Avoid just asking for scripts though as that is generally just considered lazy, although you only asked for advice on this occasion. So all good :)
$$anonymous$$mmpies thank you very much for the feedback and guidance I'm going to reference Youtube and see if I can find a tutorial that explains more. I'm slowly getting the hang of scripting, but I'm extremely new to Unity, as well as, coding. I can't wait until I'm able to create very basic stuff and get a better understanding of Unity because it's very cool seeing things actually work after you've started from nothing.
No problem and don't forget those scripting tutorials, I turned the words into a link in my original comment but it's not very clear in the comments font size.
Good luck :)
Your answer
Follow this Question
Related Questions
error CS0120: An object reference is required to access non-static member `ScoreManager.score' 1 Answer
How to make an enemy 2d chasing player? 1 Answer
Wrong after Update? 0 Answers
warning CS0618 with unity ngui 0 Answers
Same Q as before but it has been a while and nones replyed so im reposting 2 Answers