how do i make a missile to follow a specific actor?
so basically i want to create a special weapon for my main actor when it shoot i want to spawn like 3 missiles at once, and then if i have 3 enemies i want each of the missile to follow one actor each, i have no problems with spawning the missiles but cant make them to follow a different enemy
Comments
This is the same thing you would need to make a homing missile in a tower defense game.
Having all the enemies shoot missiles at the player is doable, but the other way around is not really feasible currently in GameSalad.
Now, in your missile actor, tell it to Move To "EnemysX"(for X) and "EnemysY" (for Y). Now, the missiles should go toward each enemy- or they will just zoom randomly around- I really don't know. I'm sorry for not being more helpful.
hope that helps.
kipper
so in the missile i have to move to game x and game y, if i have one enemy it works ok, so i add another enemy with same constraning self position x and y, so i thought i could add on the "move to" like this
ramdom(gamex,gamex2) and ramdom(gamey,gamey2) gamex2 and gamey2 is for the second enemy
so basically i wanted for the missile to chose between this two options but it moves very weird i guess because is trying to move to both destination at once
Make your main actor drop a missile, and have it move forward SLOWLY... like it's getting ready to blast off, building momentum..
add several invisible actors one below each other down the screen.. have them about 60-70% at the other side.
|--main actor---------------wall------|
in each wall piece set up an attribute,
if collide change attribute wall1 to true
in your missile
if wall 1 true
(add rules to make it fire in wall piece direction)
attribute fired true
in all rules,
if attribute fire false
what does this do?
the missle moves forward slowly, and the first actor to cross an invisible block triggers the missile to accelerate quickly toward it's direction... the same location as the enemy
if you had time.. you could add these invisible squares all over and it'd work better... but this worked fine for me.
remember.. add the if fired = false on all the rules in the missile so it ONLY fires at the first one it blows up
add a
fired = false to the collision so it resets in case you have another missile floating around