Question by
Dog-Gamer · May 06, 2016 at 12:12 AM ·
programmingprogramming-basics
Have Two variables in a if statment?
im somewhat new to javascript so i need some help please.
error im getting: Unexpected token: &&
Here is what im scripting:
if (ColgameObject.tag == "Hide")
{
//Stopping going through the floor by changing var, wait until they are out to make hid_ready = true
if (hidden == false) && (hid_ready == false)
{
hid_ready = true;
hidden = true;
transform.localPosition = Vector3(0, -0.5, 0);
//Adding a hiding script
}
}
Comment
Answer by jgodfrey · May 06, 2016 at 12:20 AM
if (hidden == false && hid_ready == false)
or
if (!hidden && !hid_ready)
Based on your next post, you obviously got this one working based on the above answer. If that's the case, please ACCEPT this answer to close out the question.
Your answer
![](https://koobas.hobune.stream/wayback/20220612080239im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How does this part of the script make sense? 3 Answers
Move the objects Y? 0 Answers
How to make my snowball model to actually shoot like a projectile? 0 Answers
Are nested ifs different from &&? 1 Answer
How to interact with closed doors 0 Answers