playMaker

Author Topic: Dynamic Target?  (Read 2505 times)

Rbanninga

  • Playmaker Newbie
  • *
  • Posts: 17
Dynamic Target?
« on: October 15, 2013, 11:06:54 AM »
Hello everyone,

I have a question in regards to targets or elements that could change dynamically. Currently a node like the Move to action requires that I set a specific object inside unity itself. But I would like this to be done from maybe a possible list or which ever entity I find inside that radius meeting some specific criteria like distance or low health as an example.

I've found an object variable in the engine... would that have something to do with it possible?

Regards and thanks!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dynamic Target?
« Reply #1 on: October 15, 2013, 11:24:59 AM »
You could make an FSM that gets any certain game objects with a tag within a radius from itself, put them into an array and compare variables to decide which one it should be selecting as the one "target" game object.

http://hutonggames.com/playmakerforum/index.php?topic=5116.0
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rbanninga

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Dynamic Target?
« Reply #2 on: October 16, 2013, 11:27:37 AM »
Hello Lane,

How exactly would I collect multiple objects in the radius though? Is their some way to setup a dynamic expanding list without this array script of yours or do I need to use it. Not saying I don't want to but curious how one would handle setting up and handling arrays without this lovely little addition. And regarding the tag would I have to make it a new layer maybe that I can target?

On another note I tried to setup your provided script and get the following error. Looks like I am missing something else..

Assets/PlayMaker/Actions/ArrayListGetMaxFloat.cs(9,45): error CS0246: The type or namespace name `ArrayListActions' could not be found. Are you missing a using directive or an assembly reference?

Regards!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dynamic Target?
« Reply #3 on: October 16, 2013, 11:36:35 AM »
Sorry, I assumed you were familiar with the ArrayMaker extension.

Addon list:
https://hutonggames.fogbugz.com/default.asp?W714

ArrayMaker:
https://hutonggames.fogbugz.com/default.asp?W715
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rbanninga

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Dynamic Target?
« Reply #4 on: October 17, 2013, 12:50:10 PM »
Nope I somehow completely missed that in the addons section! Thanks!