I'm attempting to disable/enable Gravity on an actor or prefab using the Change Fields Node/Call Function Node; but for some reason, using:
Component Name = Rigidbody Field = useGravity bool
isn't working at all.
I'm pretty sure I'm making a pretty dumb designer-y mistake as I vaguely remember accomplishing this before, but does anyone have an idea on how to disable gravity via Event Nodes?
Have you tried enabling Is Property? Usually, the exposed fields of Untiy components are actually properties :)
Also, do you get a warning message in the console?
Post edited by gamingislove on
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Ok, seems like that's happening when there is no rigidbody attached to the object ...
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Looks like I took the Rigidbody off the prefab and accidentally applied it while experimenting and trying to figure out the problem and looking at different nodes. Silly.
You were correct; it is a property, and it's working perfectly now. Thanks!
For future reference for anyone else:
Change Fields Node Component Name = Rigidbody Field = useGravity Is Property bool
Usually, the exposed fields of Untiy components are actually properties :)
Also, do you get a warning message in the console?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Property change failed (UnityEngine.Rigidbody): useGravity
Exception has been thrown by the target of an invocation.
Without Is Property, I get:
Field not found (UnityEngine.Rigidbody): useGravity
---------------------------------------
Personal Twitter: https://twitter.com/AMO_Crate
I make RFI! https://twitter.com/NootboxGames
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Yeah, I'm just an idiot.
Looks like I took the Rigidbody off the prefab and accidentally applied it while experimenting and trying to figure out the problem and looking at different nodes. Silly.
You were correct; it is a property, and it's working perfectly now. Thanks!
For future reference for anyone else:
Change Fields Node
Component Name = Rigidbody
Field = useGravity
Is Property
bool
will toggle gravity.
---------------------------------------
Personal Twitter: https://twitter.com/AMO_Crate
I make RFI! https://twitter.com/NootboxGames