accessing info from what character collides with

andy_the_bakerandy_the_baker Member Posts: 25
edited November -1 in Working with GS (Mac)
is there a way of accessing the info that a spawned character collides with? here's the scenario:

spawn a character, which automatically goes towards the enemy base. if it hits another enemy, then it attacks them. else if it gets to the base it attacks that. or if it bumps into a friendly, slow down to that speed.

also, another question: is it better to have one actor with a bunch of rules, or destroy/replace as needed? (spawn actor, destroy and replace with moving actor, destroy and replace with attack actor, etc.)

thanks.

Comments

  • andy_the_bakerandy_the_baker Member Posts: 25
    eh, just read about destroying actors not freeing any memory up. so never mind that.

    i'm starting to feel this project is too ambitious...
  • StusAppsStusApps Member, PRO Posts: 1,352
    You can set collision with different actor types to trigger different responses, sure.

    When creating a rule just set

    actor->collides or overlaps-> other actor type
    Then .......
  • andy_the_bakerandy_the_baker Member Posts: 25
    thanks. i can assign different collision tags on the castle vs. my guys vs. enemies. brilliant.

    but then i'm still left with one burning question: if there are 5 enemies on the screen, how do i know which one i bumped into?

    thank you very much for the response.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I would flip the logic around and put the collision recognition code in the enemies...

    It's much easier for a bunch of enemies to keep track of one player, than the other way around.
  • andy_the_bakerandy_the_baker Member Posts: 25
    thanks, that would work except i want competing armies. bunches of character lined up in trenches fighting each other.

    i figured something out though. my main concern was how damage was going to be assigned to the proper character. i'll put the damage assigner in a vfx actor! easy peasy lemon squeezy.

    thank you too for the reply. it is appreciated.
Sign In or Register to comment.