how to spawn an actor in the same position every scene
i want an actor spawned in the same position in every scene, i want to give it a direct position for 100% accuracy,
please help thanks
please help thanks
Best Answer
-
ericzingeler Posts: 334
Create a Position X real game attribute and a Position Y real game attribute. Set those Position X and Y attributes to the coordinates of your choice.
Now in the spawn actor behavior, set Position X to game attribute Position X and Position Y to game attribute Position Y. Set the bottom "Relative to:" drop down to the scene option.
done.
Answers
There may be a better way for your needs, but it works fine for me...
on the actor being spawned:
1st behaviors …
-changeAttribute: self.Position.X To: the correctX
-changeAttribute: self.Position.Y To: the correctY
no gameAttributes needed (conserve resources)
and you can leave the Positions for the spawn at 0
… spawnBehavior can be on any actor in the layer where that spawnedActor is active
often best to have an actor control its own behavior … such as position