playMaker

Author Topic: Wheel colliders[SOLVED]  (Read 9894 times)

blackant

  • Sr. Member
  • ****
  • Posts: 415
  • http://blackantmaster.com
    • View Profile
    • blackantmaster.com
Wheel colliders[SOLVED]
« on: May 11, 2014, 11:53:55 AM »
Maybe i'm wrong but it seems that there is no possibility to get and set some parameters of the wheel collider physic object.

i'm actually testing some way to dynamicly changes parameters like Stifness Factor, i don't see it appearing in the list of variables in set/get property action.
« Last Edit: July 17, 2015, 02:33:42 AM by jeanfabre »

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #1 on: June 30, 2014, 08:21:01 AM »
Hello Playmaker world  :)


blackant:
SetWheelColliderProperties
http://hutonggames.com/playmakerforum/index.php?topic=3981.0


Under this topic I would like to add a request regarding wheels.
Im trying to set mesh of a wheel to follow the suspension.
There is a function GetGroundHit(hit: WheelHit) in Unity docs, please check:

http://docs.unity3d.com/ScriptReference/WheelCollider.GetGroundHit.html
http://docs.unity3d.com/ScriptReference/WheelHit.html

Anthing like this done in Playmaker before? I was thinking of using raycast for each wheel to check the ground point and move the mesh accordingly, but this would take much performance no?

Whats your experience?
Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Wheel colliders
« Reply #2 on: July 16, 2014, 04:13:20 AM »
Hi,

 it depends that you are after once you got the info that the wheel has hit the ground.

 Can you expand a bit on what you are after?

 Bye,

 Jean

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #3 on: July 16, 2014, 07:22:46 AM »
Hi, thanks for your insight,

3d platform, trying to move wheel meshes up/down by following wheelcolliders.
Wheel colliders dont move up/down them selves, instead they bounce with its ray.
So I cant parent meshes to colliders.
I have tried getCollision info and collision enter, but they are something different I guess.

Idea to do this:

(picture A)
if wheelcollider isGrounded(get Property) = False,
the wheel mesh moves -Y self space x amount (like when a car is in air suspension is released)

(picture C)
if True - I could use the colliders in-built ray to get GroundHit point Y and move the mesh up/down.

Thanks

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #4 on: August 05, 2014, 03:29:24 AM »
bump

Hi, may I hear an opinion on this please?
Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Wheel colliders
« Reply #5 on: August 05, 2014, 04:15:17 AM »
Hi,

 You should totally go for a custom behavior or actual framework if you start messing with wheels... Unless you know excatyl how wheels collider is working, and it's indeed very tricky to get right.

 Typically, download the "Samples Assets ( beta)" from the asset store and in there you'll have a very well down Wheel component, that even allow you to conveniently align the wheel collider with your wheel mesh for you. so it's really powerful, and works straight away out of the box.

Typically, the wheel model should simply follow the wheel collider transform, without any fancyness.
[EDIT] I was so wrong... It's actually very tricky, and a series of custom actions would need to be done for this. I'll see if I can make a  convenient wrapper for this to be done automatically. Can you bump me sometime next week and I'll work on this.

 Bye,

 Jean
« Last Edit: August 05, 2014, 04:20:15 AM by jeanfabre »

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #6 on: August 05, 2014, 04:30:23 AM »
Thank you thank you thank you!

Will bump, no rush :)


600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #7 on: August 13, 2014, 10:22:20 PM »
bump :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Wheel colliders
« Reply #8 on: August 14, 2014, 11:06:49 AM »
Hi,

 Can we post pon that until beginning of september? I am flying to Unite this week end, and then I have PAX to attend with a client, so august is pretty much done for me...

Bye,

 Jean

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #9 on: August 14, 2014, 11:09:28 AM »
Hi,
Sure no problem,
good luck!

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #10 on: September 23, 2014, 12:13:58 AM »
bump :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Wheel colliders
« Reply #11 on: September 23, 2014, 01:25:15 AM »
Hi,

 tricky, cause Unity 5 has a total revamp of its physics, and it's way better.

 I would suggest you use a framework for this where the author gives you all the wrappers and proper wheel behavior you rwould expect. This is actually something that Unity guys strongly encourage as opposed to work from scratch with a raw wheel collider, which is hard.

Bye,

 Jean

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #12 on: September 23, 2014, 01:48:01 AM »
Hi, thanks for the reply,

Will look at Unity5, maybe its a good idea to wait and then decide how to act.
Meanwhile will try other ideas how to "cheat" suspensions visuals.
Actual wheel collider is working good, bouncing, sliding, moving the car.

Will report how this ends, the goal is to make much as possible in Playmaker :)

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 590
    • View Profile
    • Car and Traffic Playmaker assets
Re: Wheel colliders
« Reply #13 on: October 03, 2014, 04:54:45 AM »
Hello,

reporting in about those wheels,
please see video bellow, the setup for the car is working great with wheel colliders detects the suspension. Here I added a raycast for wheel meshes to animate suspension.
Now the setup is double, because of mesh raycasts and wheel colliders built-in raycast.

Any possible chance to get a property from a wheel colliders ray where did he hit something?
Like getGroundHit ? To avoid adding an extra ray.

Jean, you mentioned that it needs a series of custom actions, does that apply on that ground hit thing or wheels in general?

Thanks for looking into this.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14126
  • Official Playmaker Support
    • View Profile
Re: Wheel colliders
« Reply #14 on: November 07, 2014, 12:45:56 AM »
Hi,

 ok, sorry for the delay, slowly catching up.

 Can you try these two actions, they are available on the Ecosystem:

GetWheelColliderGroundHitProperties

GetWheelColliderisGrounded

 Bye,

 Jean
« Last Edit: July 17, 2015, 02:06:47 AM by jeanfabre »