0 registered members (),
16,643
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Need some car related help, wierd bug
#56662
10/01/05 08:12
10/01/05 08:12
|
Joined: Nov 2004
Posts: 113 canada EH!?
zammmm
OP
Member
|
OP
Member
Joined: Nov 2004
Posts: 113
canada EH!?
|
Hello, I got this wierd problem or bug when I try to drift or wrap my car around, the back wheels turn 90 degrees and if it goes past that it starts spinning and going out of control, I can not figure it out.  Has anyone ever encountered this or anything, I would think it is the joints problem, but Im not sure, Ill just post that code for now, please ask if you want to see something, I cant seem to get it to work. Code:
function createRearLeftWheel () { rearLeftWheel = my; rearLeftWheel.shadow = on; rearLeftWheel.pan += 180; rearLeftWheel.scale_x = 1.5; rearLeftWheel.scale_y = rearLeftWheel.scale_x; rearLeftWheel.scale_z = rearLeftWheel.scale_x; phent_settype (rearLeftWheel,ph_rigid,ph_sphere); phent_setgroup (rearLeftWheel,2); phent_setelasticity (rearLeftWheel,1,5); phent_setfriction (rearLeftWheel,120); phent_setmass (rearLeftWheel,130,ph_poly); wheelConn [2] = phcon_add(ph_wheel,player,rearLeftWheel); phcon_setparams1(wheelConn [2],rearLeftWheel.x,vector (0,0,1),vector (0,1,0)); phcon_setparams2(wheelConn [2],nullvector,nullvector,nullvector); }
function createRearRightWheel () { rearRightWheel = my; rearRightWheel.shadow = on; rearRightWheel.scale_x = 1.5; rearRightWheel.scale_y = rearRightWheel.scale_x; rearRightWheel.scale_z = rearRightWheel.scale_x; phent_settype (rearRightWheel,ph_rigid,ph_sphere); phent_setgroup (rearRightWheel,2); phent_setelasticity (rearRightWheel,1,25); phent_setfriction (rearRightWheel,80); phent_setmass (rearRightWheel,100,ph_poly); wheelConn [3] = phcon_add(ph_wheel,player,rearRightWheel); phcon_setparams1(wheelConn [3],rearRightWheel.x,vector (0,0,1),vector (0,1,0)); phcon_setparams2(wheelConn [3],nullvector,nullvector,nullvector); }
-- Send me a shout at zammmm@gmail.com, also got MSN messenger, Xbox Live, "random FIRE", Xfire, "zammmm" and Steam, "zammmm".
--------------------
|
|
|
Re: Need some car related help, wierd bug
[Re: zammmm]
#56663
10/01/05 13:01
10/01/05 13:01
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
try using ph_sphere instead of ph_poly on the wheels, you limited the hinges to not let it roll it's own axis over, so dont worry about that. Code:
phent_setmass (rearLeftWheel,130,ph_sphere); and in the toher function phent_setmass (rearRightWheel,100,ph_sphere); try it like this. in my experience with physics (ragdolls, race cars, nascars, anything you can think of, even minigolf) i've found out ph_poly makes on impact objects "explode", i allways try to avoid it, only thing i use it on is my chassis. regards,
Last edited by dennis_fantasy; 10/01/05 13:02.
|
|
|
|