playMaker

Author Topic: Problem with ADD TORQUE[SOLVED]  (Read 3537 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Problem with ADD TORQUE[SOLVED]
« 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:
  • Playmaker has a standardized ADD TORQUE action that applies the force to a point too near to the axis, so increasing the power doesn't really add up. This can be easily circumvented.
  • Or, it's Unity to have this problem. This would be a little bit harder to fix.
  • Or, PhysX doesn't "expect" that such high torque added to an object, so it's limited in this regard. If so, I'm f**ked. But I don't think it's probable.

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
« Last Edit: September 11, 2018, 01:45:43 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with ADD TORQUE
« Reply #1 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

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Problem with ADD TORQUE
« Reply #2 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with ADD TORQUE
« Reply #3 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

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Problem with ADD TORQUE
« Reply #4 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?

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Problem with ADD TORQUE
« Reply #5 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Problem with ADD TORQUE
« Reply #6 on: September 10, 2018, 03:35:09 PM »
Hi,

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

 Bye,

 Jean

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Problem with ADD TORQUE
« Reply #7 on: September 10, 2018, 10:08:05 PM »
Duh! Thank you! Sorry, next time I'll search the EcoSystem first!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Problem with ADD TORQUE
« Reply #8 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"

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Problem with ADD TORQUE
« Reply #9 on: September 11, 2018, 01:05:40 AM »
Great!  :o :D