❔ 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#)

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

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

But show the rigidbody when gravity doesn't turn off.

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.

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

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

it said build interupted
Press attach to unity
no need to press the 'and Play' button
nothing bad happened?

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.