Stencyl 3.4.0 is now out. Get it now!

Problem with Revolute Joints

Hello Stencyl

I have been playing around with the joints extension but can't seem to get the effect I'm looking for. All I want to do is anchor an actor to a point on the screen and have it freely rotate around that point (I want gravity to affect it so it hangs down and swings, like a piece of wood nailed to a wall). I have managed to connect my actor to the screen with a revolute joint but it does not swing freely for some reason, I have gravity and rotation enabled for the actor but it either just stays in the same position as if gravity isn't effecting it or it flips about and spins round of its own accord.

I also want to be able to have it rotate when the player presses the mouse so I have added a motor, which works well but when I release the button, disable the motor and set the motor speed to 0 it just stays in the same position where as I would like it to fall as if gravity was effecting it.

I know there has to be an easy way to do this as I can see it working in some of the joints examples but I just can't figure it out, if any body could help it would be awesome

Thanks

LIBERADO

  • *
  • Posts: 2486
Change the coordinates in the block to create the revolute joint.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

Thank you for replying but I'm sorry I don't understand, would you be able to explain a bit further? This is the code I'm using to create my revolute joint. I'am creating the joint from the main scene should I be creating it inside the Test Actor? Other than this code there is nothing else acting on the Test Actor.

Thanks

Few! Got it working, thanks for pointing me in the right direction.

For anybody having a similar problem I was creating the revolute joint at the top of actor when I should have been creating inside the actors body.

Thanks again LIBERADO  :)

LIBERADO

  • *
  • Posts: 2486
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.