playMaker

Author Topic: How to set Physics Material - Bounciness?[SOLVED]  (Read 2325 times)

Ouch

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
How to set Physics Material - Bounciness?[SOLVED]
« on: February 02, 2014, 04:43:26 AM »
Is it possible to set the bounciness of a physics material attached to an object's collider in Playmaker?

I have a GUI Slider that I would like to hook up to this parameter, but can't see it listed anywhere.

Thanks
« Last Edit: February 04, 2014, 10:47:39 AM by jeanfabre »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: How to set Physics Material - Bounciness?
« Reply #1 on: February 02, 2014, 08:01:02 AM »
http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html

When creating a new phys mat the option is right there.

Ouch

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to set Physics Material - Bounciness?
« Reply #2 on: February 02, 2014, 03:43:51 PM »
Thamks for the reply. Sorry, i don't understand. I don't want to create a new material, simply access an existing one's bounciness parameter in Playmaker so the user can change it with a gui slider. I can't find any access to it via Actions/physics, or anywhere else.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: How to set Physics Material - Bounciness?
« Reply #3 on: February 02, 2014, 03:59:44 PM »
Oh, right I misunderstood.

Make a new Object variable, choose UnityEngine > PhysicMaterial.
You can use Get Component to fill the Object variable from your material.
Add a Set Property action, choose that Object var.

Thats a roundabout way of changing the variable, you just need to connect the slider to the variable.

Ouch

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to set Physics Material - Bounciness?
« Reply #4 on: February 04, 2014, 05:23:28 AM »
Thanks very much, worked like a charm :)