1 - Create an empty object
2 - Add a Moveable_drag component to it
3 - Set Drag mode to Rotate only
4 - Set Freeze Rotation X and X on the RB
5 - Uncheck "Use Gravity" on the RB
5 - Check "Disable gravity when held" on the M_drag
6 - Press Play
Unwanted behaviour:
The rigidbody gets its Use Gravity flag set to true on start
Desired behaviour:
The Moveable_Drag component just keeps things as they are without asking or an explanation about the reason of the change.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
As intended. With Disable gravity when held? checked, gravity will be disabled when held, and enabled when not held.
I see.
Personally, I believe that this kind of "silently autoconfiguring behaviours" are a bit confusing, and undocumented. At least, to me.
Some users not so familiar with coding may consider it useful.
I'd rather check myself that flag from the beginning, only if I wanted to.
Maybe add a "Enable Gravity on start" flag, which defaults to true to avoid breaking code?
Or at least having a permanent text (a tooltip isn't enough) explaining that checking it will also take full control of the rigidbody at start?
Just my 2 cents. If it's by design, I can't argue with that, you're the boss