Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: PolyMad on September 09, 2018, 07:29:35 PM

Title: Problem with ADD TORQUE[SOLVED]
Post by: PolyMad on September 09, 2018, 07:29:35 PM
I don't really know if this is a problem coming from Playmaker, Unity or PhysX itself.

Fact is, I add torque to the wheels of my vehicle, but there seem to be a ceiling to the power that can be added, and I'm EARLY hitting that ceiling.
In fact, my vehicle can't go past something around 80 Km/h (didn't check exactly, still have to make the speedometer, but surely it's not the 300 Km/h I need).

For the same problem, I can't rotate the front wheels with the needed decision and power: I have to put low spring power so to be able to rotate them with the weak power the ADD TORQUE action gives.

I tried to put 100, 1000, 10000 and millions, but it simply doesn't change anything past 100 I think.

My hypothesis are:

Does someone have any idea about what's going on?
I'm stuck, because I'm making a racing game, not a pizza delivery simulation  :-X

You can download a build to see what's going on (ZIP file for Windows x64):
https://drive.google.com/open?id=1cn_2H1LOLC4BJcFpAJXoGI0426JM4YiO (https://drive.google.com/open?id=1cn_2H1LOLC4BJcFpAJXoGI0426JM4YiO)
Title: Re: Problem with ADD TORQUE
Post by: jeanfabre on September 10, 2018, 02:18:01 AM
Hi,

 that could be your drag factor and angular drag on your RigidBody ( both car and wheels)

Bye,

 Jean
Title: Re: Problem with ADD TORQUE
Post by: PolyMad on September 10, 2018, 03:21:35 AM
Ye, that was the first thing I thought about, as it feels like swimming in honey, but it isn't: I put them both to 0 in all the affected rigidbodies.
Title: Re: Problem with ADD TORQUE
Post by: jeanfabre on September 10, 2018, 12:56:11 PM
uhm..

 I would ask on Unity forum and UA just to make sure something else is in the way.

 Bye,

 Jean
Title: Re: Problem with ADD TORQUE
Post by: PolyMad on September 10, 2018, 01:18:47 PM
I've probably found the problem, thanks to this guy:
https://answers.unity.com/questions/1094917/why-does-my-rigidbodyaddtorque-gets-limited.html

https://docs.unity3d.com/ScriptReference/Rigidbody-maxAngularVelocity.html

There's a Rigidbody.maxAngularVelocity parameter that manages the PhysX objects.

Could you make an action to set this up?
Title: Re: Problem with ADD TORQUE
Post by: PolyMad on September 10, 2018, 01:19:44 PM
For now I managed to add a little C# with the command to set the parameter and it works  :D
Title: Re: Problem with ADD TORQUE
Post by: jeanfabre on September 10, 2018, 03:35:09 PM
Hi,

 ah! that's the one.... it's on the Ecosystem : RigidBodySetMaxAngularVelocity

 Bye,

 Jean
Title: Re: Problem with ADD TORQUE
Post by: PolyMad on September 10, 2018, 10:08:05 PM
Duh! Thank you! Sorry, next time I'll search the EcoSystem first!
Title: Re: Problem with ADD TORQUE
Post by: djaydino on September 10, 2018, 10:24:00 PM
Hi.
just to let you know.
On the Ecosystem you can even search by pieces of code :)

in your case for example search for "maxAngularVelocity"
Title: Re: Problem with ADD TORQUE
Post by: PolyMad on September 11, 2018, 01:05:40 AM
Great!  :o :D