playMaker

Author Topic: LOCK on enemies help  (Read 819 times)

bordrin

  • Playmaker Newbie
  • *
  • Posts: 4
LOCK on enemies help
« on: December 08, 2020, 07:36:44 AM »
hello guys, i working on lock_on system in playmaker ... i make game something like darksouls ... so what i need.
have a player, in player have a trigger collider who is looking for enemies. so if the enemies go through the collider it will automatically find the nearest enemy. that function in play maker * find closest * with tag.
so if i press the Q button, the lockon system will find the nearest enemy. now what i need. i want if i press any button (for example R buton), it will find my next enemy in collider, if there are more enemies. is there any function in the play maker for that? or I have to do the script manually. any ideas? thx

bordrin

  • Playmaker Newbie
  • *
  • Posts: 4
Re: LOCK on enemies help
« Reply #1 on: December 08, 2020, 08:41:52 AM »
btw lock on is : player and camera rotate to target and lock it ... :D something like *smooth look at* in playmaker.

LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
Re: LOCK on enemies help
« Reply #2 on: December 08, 2020, 05:17:41 PM »
You could use ArrayMaker (its on the ecosystem), when the enemies are in the your collider (I would use overlap Sphere or box). Then add them to an array list (array maker), then you can use Array List Get Next to cycle through them.
I haven't tried this but did something similar in the past to get all objects in a overlap sphere.

I just realized there s an action called Get Next Overlap Area 2d, I wonder if there is something similar for 3d (assuming you are working in 3d)?
Have I said how much I love playmaker!!! This is one amazing tool