- Home /
Grounded bool acting weird
Hi guys! So, I've got a scene set up with a character that can jump moving around a space, but for some reason, whenever I go to the corner of the area where I have a wall set up and then turn and walk the opposite direction, my 'grounded' bool is set to false for a second, triggering the jump animation. This isn't a huge problem, but just wondering if anyone's experienced this before? Thanks.
Good day.
If the bool variable changes, is because some line of code is doing it. When you set true/false the variable?
Answer by Eno-Khaon · Apr 04, 2018 at 07:55 PM
Based on the description alone (you should really provide an example of your scripts where "grounded" is used), I can only guess that you're setting grounded to true nearly unconditionally in OnCollisionEnter() (or OnCollisionStay()) and setting it to false in OnCollisionExit().
With that in mind, when you touch, then walk away from a wall, that sets grounded to false until the ground you're standing on sends a new signal to remind you that you're touching it.
Your answer
Follow this Question
Related Questions
About in air control 2 Answers
How to keep ball from jumping more than once? 1 Answer
I need help with animations. 0 Answers
Having Trouble animating camera at start of game 1 Answer
Trying to Add jump to this code. 1 Answer