Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [boolean]

The tag has no usage guidance.

0
votes
1answer
34 views

If statements seem to act as though the condition is always true

I have other scripts in the same project using boolean if statements that work fine, but I've tried multiple methods of testing if the if statements below are working and none of them worked! I don't ...
0
votes
1answer
422 views

Unity 5 2d Magnet Power Up

I made a car game with coins and power up but i wrote a code for magnet power up but in start work fine but after i get power up magnet all coin in surface i collect but after this don`t spawn coin ...
0
votes
1answer
16 views

Issues with Toggle

hope you're all good.. I'm struggling with a simple toggle for inverting Y axis.. What i have works for my first scene but i'm trying to keep this setting through all scenes, hence why the script ...
4
votes
1answer
758 views

How do I get diagonal 3d movement when two buttons are pressed?

I have a model moving using root motion. Currently, it's moving in 4 directions; Forward, Backward, Right, and Left. Now, I want to make the character move in 45 degrees. I made a chart to understand ...
0
votes
1answer
108 views

Playing an animation all the way through with one quick keypress with Mechanim Unity

I have an if statement inside of the Update function that is only called if three other conditions are met. The problem is that right now the function sets a boolean to true which causes the animation ...
-2
votes
1answer
23 views

Unity3D: Entering a trigger disables a few bools for no reason

I'm trying to make it so when an object enters a collider with the tag "Down" a single boolean turns false, but the problem is that more than one booleans(canGoUp, canGoLeft, canGoRight) are turning ...
5
votes
2answers
10k views

Is there a random command for Boolean variables in Unity C# [closed]

Can you randomly choose a Boolean's value in Unity C#. I tried random.range, but it only works with floats. Here is an example of what I'm trying to do: ...
1
vote
0answers
27 views

How to save characters in iOS game app

BOOL = GREENIE, UIButton =GREEN. When I click the GREEN button, I coded that now you play as GREENIE character. However, I don't know how to code it that the game always remember that the I clicked on ...
3
votes
1answer
215 views

If-clause in GLSL

I read a few thing about, that in GLSL both sides of the if-clause is executed, so do you have any idea for a workaround for this one: ...
0
votes
3answers
230 views

Drawing sprites only under certain conditions - alternatives to using 'if statements'?

Within my game (which is Java/Android), I wish to draw a sprite only under certain conditions, so up until now, I've been using if statements to accomplish this. Something like so: ...