playMaker

Author Topic: changing the character controller max speed & footsteps sound  (Read 6178 times)

mrbdrm

  • Playmaker Newbie
  • *
  • Posts: 39
Hi
i have been trying to do these two with no luck .
1- i want to change the speed of the player if the player collide with a taged game object .
2- make footsteps spund if the player foot ( 3d person ) collide with a taged game object .
the second one i tried the action on collision inter but play maker never detect the action .

mrbdrm

  • Playmaker Newbie
  • *
  • Posts: 39
Re: changing the character controller max speed & footsteps sound
« Reply #1 on: May 22, 2011, 07:28:32 AM »
anyone ??
i have tried set game object still cant access the variable :(

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • FluidPlay Studios
Re: changing the character controller max speed & footsteps sound
« Reply #2 on: May 22, 2011, 12:31:58 PM »
You'll also need a rigidbody added to any object that you want to check collision. You can disable gravity and toggle on "is kinematic" if you don't really want it to collide physically. Also remember if you toggle on "is trigger" you have to use 'on trigger' events and not on collide.

Also notice that to check the tag you'd better not use the default (in CAPS) transitions, use the tag-validated collision actions instead.
--
Breno "MaDDoX" Azevedo
@brenoazevedo

mrbdrm

  • Playmaker Newbie
  • *
  • Posts: 39
Re: changing the character controller max speed & footsteps sound
« Reply #3 on: May 22, 2011, 02:27:51 PM »
thanks :)

but still the bigger problem the controller max forward speed variable , how to set it in run time ?

mrbdrm

  • Playmaker Newbie
  • *
  • Posts: 39
Re: changing the character controller max speed & footsteps sound
« Reply #4 on: May 24, 2011, 03:22:58 PM »
i tried using the action trigger event but it only trigger for the first frame only then never detect it again
i tagged the floor "ground" and set it in the action properties .
does the action trigger event don't work with moving object like the player ?
i can't use collide event bc of locomotion get messed up , any other way ?
 

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • FluidPlay Studios
Re: changing the character controller max speed & footsteps sound
« Reply #5 on: May 25, 2011, 02:12:42 PM »
i tried using the action trigger event but it only trigger for the first frame only then never detect it again
Have you checked in the "every frame" toggle?

Quote from: mrbdrm
but still the bigger problem the controller max forward speed variable , how to set it in run time ?
Well, I won't pretend I have spent much time with the Unity's default character controller (which's what I assume you're using), so I might be quite off in what I'll say here. I have many reasons to prefer using a standard rigidbody/collider and build my own controller on top of it - one of them being that I get full control of how things happen. Max speed is one of those things, in the default character controller you set that parameter directly in one of the character controller components (IIRC, there are two). Now, if you want to make that change-able straight from Playmaker - what you want, if I understood correctly - you'd need a specific action to do it.

There's no built-in/easy way right now for Playmaker to "see" some component attribute, you can turn it on or off and you can code your component (script) to send and receive parameters from a Playmaker FSM but that's it. Personally I prefer to have everything in action format instead of mixing standard scripts with actions, except if the script does something standalone that doesn't need communication with any other systems, like a game-start object instancer for example. Alex did mention some plans to make these component parameters easier to access/change btw.

That said, considering that what you're asking for is pretty trivial, you should probably post an 'action request' for that in the appropriate forum. Who knows, I might even code that in myself once I get some free time :) Good luck!
« Last Edit: May 25, 2011, 02:15:01 PM by MaDDoX »
--
Breno "MaDDoX" Azevedo
@brenoazevedo