playMaker

Author Topic: Turretsystem[SOLVED]  (Read 3010 times)

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Turretsystem[SOLVED]
« on: December 29, 2014, 04:35:04 PM »
Hi

I've got a Question.
I'm working on a top down space shooter and i have drone which spawn by picking up an item.
The ship is moved by translation.

My question is.
Every drone has a cylinder as a trigger ... something like a field of view.
I want that the drone fire at the enemy who touches the trigger.

So i have a cylinder as trigger. But when enemy touches it nothing happens.
How can i handle this?

If you need more informations to be able to help me out.
Juts ask!^^

Thanks
« Last Edit: January 04, 2015, 11:51:05 AM by Mornar »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Turretsystem
« Reply #1 on: December 30, 2014, 12:14:02 PM »
Do you have the trigger set to activate based on the enemy tag?
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Turretsystem
« Reply #2 on: December 30, 2014, 02:36:13 PM »
A Rigidbody is required on the object entering the trigger in order to trip it.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Turretsystem
« Reply #3 on: December 31, 2014, 08:01:49 AM »
Yes the enemies have their own tag. And I tried it with rigidbody.
Is it possible that i have to change some settings in the tags or the rigidbody?

thx

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Turretsystem
« Reply #4 on: December 31, 2014, 08:39:11 AM »
Perhaps you disabled the interaction between the layers in the Collision Layer Matrix?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Turretsystem
« Reply #5 on: January 02, 2015, 06:53:15 PM »
Allright. That was it.
And now i have to store the position of this enemy so the turret can look at him.

But how can I store his position...exactly that enemy who entered the trigger.
I have tried some possibilities but when I have some more of these enemies everyone would be stored^^

How can i tell the fsm just to store the position of this guy who enters the triggerarea?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Turretsystem
« Reply #6 on: January 02, 2015, 06:54:36 PM »
When something enters the trigger you have the option to Store Collider, which is the object that entered. Then just use Get Position and store the vector3 for the xyz.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Turretsystem
« Reply #7 on: January 02, 2015, 06:56:22 PM »
Ah .. omg i saw this before but i have forgotten this tiny little pull down menu...thank you i will try that.

Mornar

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Turretsystem
« Reply #8 on: January 02, 2015, 08:44:12 PM »
Allright this works perfect now.
But a little mistake of mine came up.

Right at the moment my bullets move with ITween Move Add...and because of that the bullets are not flying in the direction in which the canons are looking.

Which settings oder move action do i need for this issue?

Is there an easy way...beacause i have an idea for a little more complicated way.

Like....Put an Child on every BulletSpawnPoint in the distance i leke the bullets to fly. And tell them to move to this point.
So the Child allways turns with the canon?

Do think this is good or is there a easier way to do this?
« Last Edit: January 02, 2015, 08:50:19 PM by Mornar »