Page 1 of 1

[RESOLVED]Button Collision for anybody who needs this.

PostPosted: Sat Jan 07, 2012 6:05 am
by raminkhan
Guys I am not lazy it's been a good 4 hours I am working this problem but IT JUST doesn't work out :( :cry: Please see this picture and help I have explained in the picture what I need.

here is what I have tried based on what skyderiegn told me he told me to make 2 vars like collide_button_state set one of them to 1 and the other one to 0 and the 1 should be on mouse button down and etc. so I did that and on my victim actor I made a case statement which says: this


Collision>Player>script editor:

switch(Action)
{
case 0: collide_button_state=0;
break;
case 1: collide_button_state=1;
{
DestroyActor("Event Actor");
}
break;
}

and on mouse button down I set my var to 1
and on mouse button up I set my var to 0


So what am I doing wrong because it's not doing anything.

Re: Please see attached Especially You Mr. Sky Please

PostPosted: Sat Jan 07, 2012 7:17 am
by skydereign
You are asking the same question in multiple places again. I know you've been working on the problem, but I'd suggest waiting at least a day before reposting the question. Now I've answered the specific questions on your other post, but from this it's pretty clear you had even less of an idea of what I meant. I only mean to create a single variable, collide_button_state.
button -> Mouse Button Down (Left) -> Script Editor
Code: Select all
collide_button_state=1;

button -> Mouse Button Up (Left) -> Script Editor
Code: Select all
collide_button_state=0;


That way you can have your player's collision like this.
player -> Collision with Ball -> Script Editor
Code: Select all
if(collide_button_state==1) // this code only triggers when the button is pressed
{
    // put your collision code that you want to trigger when the button pressed is here
    // here you say to destroy the ball actor
    DestroyActor("Collide Actor");
}

Re: Please see attached Especially You Mr. Sky Please

PostPosted: Sat Jan 07, 2012 7:40 am
by raminkhan
YOU R THE GREATEST ** WOW ** it worked you know what it was sky, I had to set the repeat collision to yes I had it as no. but anyway now it works like a piece of cake. :D