Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / joint wheel to body

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Nov 2014 10:57
Hi.

I wrote code that the wheel can rotate and move to left and right with arrow keys. now I want joint a body to wheel like a car but when do it, the wheel don't move and rotate.

I attached My Project.

Please Guide Me.

Thanks.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 28th Nov 2014 18:33
You have welded the wheel to the body, hence it won't move. You need to create a revolute join so the wheel can revolve

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Nov 2014 19:52 Edited at: 28th Nov 2014 20:15
Thanks, I fix it.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Nov 2014 20:23 Edited at: 2nd Dec 2014 10:57
when I joint wheels to body my result is similar this picture:



how can make it?
easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 29th Nov 2014 00:44
Can you please post the code you're using?


Audacia Games - Latest WIP - AUTOMAYTE 2.1, AppGameKit one click deploy to Android
"When you've finished 90% of your game, you only have 90% left"
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 29th Nov 2014 08:32 Edited at: 29th Nov 2014 08:34
Quote: "Can you please post the code you're using?
"


sure.

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 30th Nov 2014 08:18
any idea?
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 30th Nov 2014 14:03 Edited at: 30th Nov 2014 14:12
I think if use half shape box, make half body sprite move down, but I don't know how can resize shape box.

like this picture.

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Dec 2014 08:08
can anyone help me?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 1st Dec 2014 10:04
Just create the revolute joint higher up.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Dec 2014 11:18
Try using "SetSpritePositionByOffset" for positioning the wheels (this command uses the centre of the sprite by default). Then create the joint at the same point. It's much easier to position sprites using an offset in my experience.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 2nd Dec 2014 10:54
Quote: "Just create the revolute joint higher up.
"


Thanks CJB for your idea.


Quote: "
Try using "SetSpritePositionByOffset" for positioning the wheels (this command uses the centre of the sprite by default). Then create the joint at the same point. It's much easier to position sprites using an offset in my experience."


Thanks baxslash. yes Use SetSpritePositionByOffset is very easy and fix my Problem.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Dec 2014 11:18
Glad to help

Login to post a reply

Server time is: 2024-11-25 11:45:23
Your offset time is: 2024-11-25 11:45:23