C
C#3y ago
.fegan

❔ 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
Buddy
Buddy3y ago
Did you debug it?
.fegan
.feganOP3y ago
no issues its just it wont turn off even when i try to do it manually
Buddy
Buddy3y ago
Did you put a breakpoint?
.fegan
.feganOP3y ago
what u mean
Buddy
Buddy3y ago
$debug
MODiX
MODiX3y ago
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.
.fegan
.feganOP3y ago
there is nothing wrong with the code?
Buddy
Buddy3y ago
Hold up.
.fegan
.feganOP3y ago
i just need to know why my rb gravity wont turn off
Buddy
Buddy3y ago
Is Rigidbody set to Kinematic?
.fegan
.feganOP3y ago
na i cant move when it is
Buddy
Buddy3y ago
Kinematic means that physics does not affect the rigidbody
.fegan
.feganOP3y ago
it doesnt work tho
Buddy
Buddy3y ago
I asked if you had it enabled, I never said you need to enable it. 🙂 I do however wonder what the inspector says
.fegan
.feganOP3y ago
ohh lol not thining straight as ive been coding all day
.fegan
.feganOP3y ago
.fegan
.feganOP3y ago
lines lol
Buddy
Buddy3y ago
$paste
MODiX
MODiX3y ago
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!
.fegan
.feganOP3y ago
BlazeBin - xozncblzkmri
A tool for sharing your source code with the world!
.fegan
.feganOP3y ago
see if u can find the issue lol
Buddy
Buddy3y ago
Unity inspector though But keep the code you posted.
Buddy
Buddy3y ago
This
Buddy
Buddy3y ago
But show the rigidbody when gravity doesn't turn off.
.fegan
.feganOP3y ago
.fegan
.feganOP3y ago
the gravity doesnt turn off even if i click it manually
Buddy
Buddy3y ago
Put a breakpoint whenever you "turn it off" $debug
MODiX
MODiX3y ago
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.
Buddy
Buddy3y ago
Buddy
Buddy3y ago
attach the editor and then run unity
.fegan
.feganOP3y ago
?
Buddy
Buddy3y ago
Click the link and read it I'm guessing the code does not run.
.fegan
.feganOP3y ago
yeah it does
Buddy
Buddy3y ago
Or it you get an error
.fegan
.feganOP3y ago
nope no error;s
Buddy
Buddy3y ago
screenshot console window in Unity
.fegan
.feganOP3y ago
thats why i dont know tf thats happening here
.fegan
.feganOP3y ago
Buddy
Buddy3y ago
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.
Buddy
Buddy3y ago
Press this
.fegan
.feganOP3y ago
it said build interupted
Buddy
Buddy3y ago
Press attach to unity no need to press the 'and Play' button
.fegan
.feganOP3y ago
nothing bad happened?
.fegan
.feganOP3y ago
Buddy
Buddy3y ago
Set a breakpoint on that line where you set useGravity and check what !OnsSlope() returns
Accord
Accord3y ago
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.

Did you find this page helpful?