playMaker

Author Topic: Switching characters?  (Read 2108 times)

Rbanninga

  • Playmaker Newbie
  • *
  • Posts: 17
Switching characters?
« on: October 19, 2013, 04:58:44 AM »
Hello everyone,

I have a question regarding switching the character you control during gameplay. How would I go about switching to another player for example in a team game like soccer? So I am playing one character and then I pass the ball to another player and assume control of the character that currently has the ball. Another example would be a puzzle game where I control more then one character and at any point in time I would like to switch between one or the other character. Is this possible and if so could somebody point me in the right direction? I must have missed some state switch controller or something.

Thanks and hopefully this does not come across as to noobish of a question... :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Switching characters?
« Reply #1 on: October 19, 2013, 11:20:37 AM »
Are you setup so that the actual 'Player' is an empty/invisible object that sends commands to the characters or are you setup so that the controls and commands are handled locally on the characters?

Either way is very similar but you just need to add a state that says that this character is managed by AI or that it is just idled, then when you switch by clicking or whatever it just changes states to be in a state that has all of the controls and inputs being pushed onto the character. Or, that the commands from the 'player' are sent to that particular character/gameobject instead, so it would be a trick of defining the target object that the commands are sent to.

Its a matter of defining a "not controlled by the player" state and triggering it appropriately or changing the target object for commands.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D