Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
With that function you could check for collisions with walls along the line from the turret to the player. If there are no collisions then it has a clear shot and you can draw your line from the turret to the player.
In the case of there being a collision with the wall you could either just have it not shoot or instead draw its line only from the turret to the wall so simulate it hitting the wall.
What error message are you getting?
If that's the case, you might just create a rapid fire bullet, that is firing so fast it looks like a solid line. That way you could destroy each instance with a wall collision event, and it would still look like a solid laser line.
Something like...
Alternatively, if your laser beam is just a line that goes from the turret to the player you could just not have it be an object at all. The line drawing is only visual anyway.
So instead of having your turret create a laser beam object you could have it do a 'collision_line" check to see if it can hit the target and if so then draw your laser line and deal your damage to the player. If you need the line to last on screen for a bit just use an alarm that gets set when it shoots and as long as the alarm is going draw the line.