How do I Make the turret change target with mouse click?

Get help using Construct 2

Post » Fri May 01, 2015 4:12 am

I have the turret to attack closes target but sometimes i want it to hit a specific target. is there a way to do that with a mouse click?
B
3
Posts: 7
Reputation: 189

Post » Fri May 01, 2015 7:58 am

Are you wanting to disable the turret action and manually control firing at selected target, or are you looking to change the turrets target selection via selecting a new target by clicking it?
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Sat May 02, 2015 4:23 am

i want the turret to change target when you click on the target. so the turret will switch to attack the one you clicked on
B
3
Posts: 7
Reputation: 189

Post » Sat May 02, 2015 7:29 am

Try this example I threw together:

https://drive.google.com/open?id=0Bx-ufu2WID53Y0N4RkdsczVXYVk (use download arrow in upper right corner)

It starts out attacking default purple cube but will switch to blue if you click it and back to purple if you click it...
Last edited by chrisinfinger on Mon Sep 05, 2016 3:44 pm, edited 3 times in total.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Sat May 02, 2015 5:06 pm

Message: hyperkiller is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
chrisinfinger wrote:Try this example I threw together:It starts out attacking default purple cube but will switch to blue if you click it and back to purple if you click it...


says i cant open it as im running and older version 200 while yours is 204.2. looks like i'm going to need to wait for steam to update mine as i just got the personal.
B
3
Posts: 7
Reputation: 189

Post » Sat May 02, 2015 8:01 pm

Here is the coding, its pretty simple and straight forward. Ignore the global variable at top... its not used in this method.

Pic:
https://drive.google.com/open?id=0Bx-ufu2WID53RkNrRklPWkFuOWc
Last edited by chrisinfinger on Mon Sep 05, 2016 3:39 pm, edited 2 times in total.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Sun May 03, 2015 5:06 pm

ah alright. Thanks for showing me how!
B
3
Posts: 7
Reputation: 189


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests