Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: amaranth on May 11, 2012, 03:01:27 PM

Title: [SOLVED] enable/disable character controller w/fsm?
Post by: amaranth on May 11, 2012, 03:01:27 PM
Does anyone know if there is an action that can be used to enable/disable the character controller?

Thanks!
Title: Re: enable/disable character controller w/fsm?
Post by: Dev_Sebas on May 11, 2012, 03:12:04 PM
I thing the enable/disable FSM is good for you.
Bye
Title: Re: enable/disable character controller w/fsm?
Post by: amaranth on May 11, 2012, 04:47:28 PM
No, I think that does not work. I need to disable the character controller, not just the FSMs attached to it.
Title: Re: enable/disable character controller w/fsm?
Post by: Dev_Sebas on May 11, 2012, 05:11:06 PM
Sorry maybe remove component?
Bye
Title: Re: enable/disable character controller w/fsm?
Post by: amaranth on May 11, 2012, 05:29:52 PM
No worries! I've created a custom action that lets us enable and disable the character controller:

http://hutonggames.com/playmakerforum/index.php?topic=1556.0

(Now that I'm starting to understand how to create actions, this is getting to be way to much fun!)

:)
Title: Re: enable/disable character controller w/fsm?
Post by: justifun on May 11, 2012, 05:45:36 PM
I found that using an "set property" action to disable it works pretty well too.
Title: Re: enable/disable character controller w/fsm?
Post by: amaranth on May 11, 2012, 06:51:59 PM
Looking through "set property" right now. How did you access the character controller? I don't see it listed in the property list. I do see collider and rigidbody. And there is active, but this seems to be only for the entire game object.
Title: Re: enable/disable character controller w/fsm?
Post by: justifun on May 11, 2012, 06:54:47 PM
I just disabled the entire thing.  I think "enabled" was under the "inherited" sub tab.

Title: Re: enable/disable character controller w/fsm?
Post by: amaranth on May 11, 2012, 07:02:24 PM
Ah gotcha. Nah, I can't do that. I've got to keep my creature visible, but I can't have it trying to escape my mouse while I'm dragging it around on screen. :)
Title: Re: enable/disable character controller w/fsm?
Post by: Alex Chouls on May 12, 2012, 04:45:11 PM
You should be able to use Enable Behaviour:
https://hutonggames.fogbugz.com/default.asp?W54

Or Set Property - drag the component into the Target Object field and set the enabled property.
Title: Re: enable/disable character controller w/fsm?
Post by: amaranth on May 13, 2012, 09:12:56 PM
You should be able to use Enable Behaviour:
https://hutonggames.fogbugz.com/default.asp?W54

Or Set Property - drag the component into the Target Object field and set the enabled property.

Hi Alex, when I use Enable Behavior, Character Controller is not in the Behavior list. It does show Character Motor, but that's it.

I also tried Set Property, but again, Character Controller was not in the list. I did search through a few of the options, but I could not see how to attach Character Controller to the Object field.

My simple action that I created worked, but I'm still curious if there is another way to get to the Character Controller.
Title: Re: [Solved] enable/disable character controller w/fsm?
Post by: Alex Chouls on May 15, 2012, 01:50:32 PM
My mistake - a Character Controller isn't a Behavior, it's a Collider.

Apparently the way to disable a Character Controller is to set Detect Collisions to false:
http://unity3d.com/support/documentation/ScriptReference/CharacterController-detectCollisions

But your custom action also works? Checking online and running a couple of tests, it seemed that you can't use  enabled to disable a Character Controller...?
Title: Re: [Solved] enable/disable character controller w/fsm?
Post by: amaranth on May 15, 2012, 05:29:52 PM
Colliders, properties, aaahhhh! Head exploding. :D

Yup, my custom action is working. It's really just the EnableBehaviour action customized for a collider. The action is here if you want to proof it: http://hutonggames.com/playmakerforum/index.php?topic=1556.0

(disable collisions won't work for me. it would solve part of the problem. i needed to turn off collision, movement scripts, and gravity. loads of little things, so turning off the collider seemed the simplest solution. in my game, you can pick up creatures in one place and drop them in another. while i'm dragging them around with the mouse, I need for them not to wiggle, detect actions, or to drop w/gravity.)