playMaker

Author Topic: Switching controls on objects.  (Read 4296 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Switching controls on objects.
« on: April 16, 2015, 04:51:05 AM »
I'd like to set up a puzzle where the player takes control of fly trap. The problem I have is I don't know how to set up a game manager that switches the position of the players camera as well as switching controls.

So in the image below, I want to set up a empty object to switch controls from the character to the fly trap after it moves up.




How does one pull this off?
« Last Edit: April 16, 2015, 05:09:52 AM by coffeeANDsoda »

OliverAge24

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Switching controls on objects.
« Reply #1 on: April 16, 2015, 07:19:09 AM »
I'm a bit of a noob, but this is how I'd approach it...

I'd have a movement FSM on the character, and a separate movement FSM on the fly trap.

The movement FSM on the fly trap would be disabled by default, and the character one enabled.

I'd have an FSM on the Trigger... and when you do whatever triggers it, I'd have a state that disables the characters movement FSM, enables the Characters FSM. Then also, it would switch the gameobject tracked by the camera, to the Fly Trap.

If there's not an action to change the focused object from the camera follow FSM, you could have two cameras, and disable the player one + enable the fly trap one... or you could have two camera Follow FSM's... one for character, one for fly trap... and you disable + enable them, related to which character is active.

I hope that helps! I also hope I'm giving you good advice lol.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Switching controls on objects.
« Reply #2 on: April 16, 2015, 03:08:19 PM »
While I acknowledge one would have to turn off a players FSM with enable behavior action, what would that mean for making Fly Trap work without using another global transition?

OliverAge24

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Switching controls on objects.
« Reply #3 on: April 16, 2015, 07:57:16 PM »
In the same state, you could just use the another enable behavior action - to enable a Fly Trap FSM.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Switching controls on objects.
« Reply #4 on: April 16, 2015, 08:28:56 PM »
In the same state, you could just use the another enable behavior action - to enable a Fly Trap FSM.

So that means the manager/empty object manages disabling the player, enabling the fly traps fsm, controls, destroy objects, and resumes all the players FSMs?

sebaslive

  • Hero Member
  • *****
  • Posts: 572
    • Frame Tale Studios
Re: Switching controls on objects.
« Reply #5 on: April 19, 2015, 12:06:59 AM »
Here is the attachment.
All my VR games use Steam VR Playmaker Toolkit: http://u3d.as/u20
And Oculus Touch Playmaker Toolkit: http://u3d.as/QT5


Follow me @sebasRez