[RESOLVED]Button Collision for anybody who needs this.

Non-platform specific questions.

[RESOLVED]Button Collision for anybody who needs this.

Postby raminkhan » Sat Jan 07, 2012 6:05 am

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.
Last edited by raminkhan on Wed Jan 11, 2012 6:50 am, edited 2 times in total.
raminkhan
 
Posts: 63
Joined: Mon Sep 12, 2011 3:35 pm
Score: 0 Give a positive score

Re: Please see attached Especially You Mr. Sky Please

Postby skydereign » Sat Jan 07, 2012 7:17 am

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");
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Please see attached Especially You Mr. Sky Please

Postby raminkhan » Sat Jan 07, 2012 7:40 am

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
raminkhan
 
Posts: 63
Joined: Mon Sep 12, 2011 3:35 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest