Switch between 2 Characters on screen

Madolah

  • Posts: 2
Ever play Lost Vikings?  Well I'm working on a small game with a similar element.

I have 2 player characters; A and B
both spawn (i've put a 0.5s delay on second spawn)
Upon start i want initial Character in control and camera following A
Upon a press of 'SWAP' I want the Control and Camera follow to focus on B

Do I make a global attribute for this? or a 3rd Actor type and reference A and B as 'Actor type' Attributes in this 3rd actors attributes?


I've tried a similar thing i found on here back in 2012 but it doesnt seem to work for me, or im using it wrong.


 

JeffreyDriver

  • Posts: 1830
Lots of ways to go about it. One way is to have your code for the controls and camera in one behaviour that's attached to both actors. You then need some logic to enable/disable the behaviour for the actors as needed.

Another way would be to have it as a scene behaviour with a local actor attribute that you switch to one or the other.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

Madolah

  • Posts: 2
Ok, So here's what I got.

In it's own Actor Behavior;







and then this snippet edited into the 'Walking' Behavior ;


--

I can get camera to swap focus, and both respond. However BOTH respond to movement when input is given.
Also, despite checking multiple places for issue in code, 'DWARF' seems to not be able to WALK even while giving animation for it, but can jump and duck, and also move <-> while in air.....  ??? ???