Laser Collision Point

Discussion and feedback on Construct 2

Post » Tue Sep 27, 2011 7:24 pm

Hi guys. I've been looking for a way to stop a laser beam when it hits an obstacle, and here are the results I've achieved so far.
Is there a better way to do this?
Laser Collision
B
33
S
4
G
5
Posts: 9
Reputation: 5,535

Post » Tue Sep 27, 2011 11:29 pm

Hi, I was working on the same issue a bit of time ago, and achieved some pretty good results.

http://dl.dropbox.com/u/41931267/Improved%20example.capx

This example shows how to detect more than one obstacle, but there is no need for this, of course.

(Most of the credit goes to R0J0Hound)

EDIT: I should say that I didn't look at your file because i haven't upgraded to r59 yet.sqiddster2011-09-27 23:30:46
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Dec 18, 2011 2:00 am

[QUOTE=VonKarma] Is there a better way to do this?[/QUOTE]

When you detect an obstacle the laser (loop) continue with the path of the laser.

I suggest you'll replace this line:
Line: Set width to Line.Width-1

With this short command:
System: Stop loop

The new line will end the "searching" cause the laser hit something.
B
35
S
12
G
6
Posts: 111
Reputation: 7,087


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests