Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Help with Ragdoll Example (Using Joints w/o Gravity)
Started by scott097 Feb 01 2017 09:12 AM

1 reply to this topic
physics joints gravity
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

scott097

[GLOBAL: userInfoPane.html]
scott097
  • Observer

  • 2 posts
  • Corona SDK

I'm working on some code based on the ragdoll physics example that comes with Corona. I'm trying to keep all the joints on the example, but to disable gravity, so that the ragdoll doesn't float around or move in anyway, unless you drag or put it in different positions, and even then, it should remain stationary when you're done moving it. I'm assuming this should be possible, but I can't figure out what physics or body options I should be changing to make it happen. Can anyone point me in the right direction for keeping all the joints, but disabling all the effects of gravity?

 

Thanks!



[TOPIC: post.html]
#2

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,073 posts
  • Corona SDK

Have you tried turning gravity off?

physics.setGravity( 0, 0 )

https://docs.coronalabs.com/api/library/physics/setGravity.html

 

If you mean removing the effect of gravity upon a physics body, have you tried adjusting the bodies gravity scaling?

body.gravityScale = 0 

https://docs.coronalabs.com/api/type/Body/gravityScale.html

 

If neither of those are options, have you tried using touch joints on each piece of the ragdoll and actually "holding" the body upon, as if on invisible string?




[topic_controls]
[/topic_controls]