❔ when i try to turn off gravity on rb it just doesnt happen
my code is 200+ lines so, but i can show u where i try to turn off gravity (c#)
![](https://utfs.io/f/17a98d41-7c32-4371-84c4-b89682d61e91-1nq2cb.png)
46 Replies
Did you debug it?
no issues
its just it wont turn off
even when i try to do it manually
Did you put a breakpoint?
what u mean
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
there is nothing wrong with the code?
Hold up.
i just need to know why my rb gravity wont turn off
Is Rigidbody set to Kinematic?
na
i cant move when it is
Kinematic means that physics does not affect the rigidbody
it doesnt work tho
I asked if you had it enabled, I never said you need to enable it. 🙂
I do however wonder what the inspector says
ohh lol
not thining straight as ive been coding all day
![](https://utfs.io/f/7c88c33b-8950-4d55-90ad-3969f2150be8-1nq2cb.png)
lines lol
$paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
BlazeBin - xozncblzkmri
A tool for sharing your source code with the world!
see if u can find the issue lol
Unity inspector though
But keep the code you posted.
This
![](https://utfs.io/f/017ae843-645e-40ea-9660-c5590c3dc203-1nq2cb.png)
But show the rigidbody when gravity doesn't turn off.
![](https://utfs.io/f/17a1eb95-226c-4298-be0d-06225d76d796-1nq2cb.png)
the gravity doesnt turn off even if i click it manually
Put a breakpoint whenever you "turn it off"
$debug
Tutorial: Debug C# code - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
![](https://utfs.io/f/934099ab-c831-4620-ba60-e547149bb1cb-i94k82.png)
attach the editor and then run unity
?
Click the link
and read it
I'm guessing the code does not run.
yeah
it does
Or it you get an error
nope
no error;s
screenshot console window in Unity
thats why i dont know tf thats happening here
![](https://utfs.io/f/1c966c22-6607-4e77-b426-d738a41e1848-1nq2cb.png)
Well, either way. I suggest you use the debugger and put a breakpoint to see what the value results in.
if it always results in true or not.
Press this
![](https://utfs.io/f/53ef1f71-6555-467e-b172-bacae38c8834-fm8vz1.png)
it said build interupted
Press attach to unity
no need to press the 'and Play' button
nothing bad happened?
![](https://utfs.io/f/c347661d-f21a-4880-a0c4-b500e62b42d5-1nq2cb.png)
Set a breakpoint on that line
where you set useGravity
and check what !OnsSlope() returns
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.