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