Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: akira on May 15, 2014, 11:00:10 AM
-
Hi All.
First of all, sorry for my English. It’s been 3 days I’ve tried to solve this problem and finally decided to ask around for help. I have two characters (A and B) in my game that are controlled by the same controller. Point 1 and Point 2 is the trigger. Take a look at attached images for a better explanation.
(http://s30.postimg.org/56lhlarp9/image.jpg) (http://postimg.org/image/56lhlarp9/)
Here is what i wanted to achieve:
(http://s22.postimg.org/ijk9vtyjh/image.jpg) (http://postimg.org/image/ijk9vtyjh/)
1) I want the door to open when my players enter those points simultaneously. No matter whether A on point 1 and B on point 2 or vice versa.
2) How can i make my characters passing through each other with a rigidbody2d on?
-
Hello,
Is this inspired by brothers??? Anyways, down to the nitty gritty.
1. You can set up a bool system for the player being over it, so basically what you have to do is set both players to have the same tag, then have the action that say on trigger event soooo that when player enters trigger turn bool ON or 1, when player exits trigger turn bool to 0. THEN you need another FSM that is checking to see if both buttons are set to 1 = open door.
Advice: take a look at all the actions carefully because you will see that there are always better ways to do something!
2. For this you need to set both characters into the same layer, then in the physics tab under the edit menu (i think, I'm not in front of unity) uncheck the layer to collide with itself so there will still be collisions with other objects but not with anything in the players new layer.
Cheers!
-
Hi Sebalsive,
Thanks for your reply.
Brothers?? I just knew the game from you..hehe..
1) I still can't solve the problem..I tried setting the bool value for both players, set target event and everything..but still cant find the solution. Can u help me by giving more detail bout how and where to put the bool value and FSM? maybe i do it wrong..
2) Thanks for your help bout this rigidbody problem..its solved!
-
Anyone care to help me here? Still stuck on the same problem.. =(
-
I'll put together a basic project. Just give me a few minutes. ;)
-
(http://i.imgur.com/n3JyoH3.gif)
I tried to keep things generic. Normally I'd prefer to use some ArrayMaker magic to add an unlimited number of inputs/buttons, but this does what you need.
(http://i.imgur.com/CucNcrs.jpg)
I prefab'd it up and added public/inspector variables so you could plug in whatever buttons/inputs you need. With a little bit of playing around, you could add switches/levers as inputs too.
The door opening is a simple tween. You could add button exit logic to close the doors again. Just do everything in reverse. ;)
EDIT: Woops forgot to attach. Here we go!
-
Thanx a lot TrentSterling!! You're a lifesaver!! ;D
I can now move on to next phase!! Owh finally....
Many many thanx!! :D