How do I do this?
rino
Member Posts: 17
Hi there, this should be an easy question for most of you but I can't figure out how to do it yet.
I have a spawner that spawns actors on random points and I want to all to converge on one target or one spot on the screen.
Or in other words, I want the spawned actor to 'follow' or reach the target (which is in the middle of my screen).
How should I do this?
Thank you!
I have a spawner that spawns actors on random points and I want to all to converge on one target or one spot on the screen.
Or in other words, I want the spawned actor to 'follow' or reach the target (which is in the middle of my screen).
How should I do this?
Thank you!
Comments
If your target is a player, then you can set a global variable for the players X & Y, and then in your player actor update that variable every so often(self.position.X & self.position.Y). and set the Player X & Y variable as your X & Y in the MOVE TO behavior on the spawned actor..
...BTW if your developing for iphone avoid using the spawn, it will absolutely kill your performance.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
And thank you for the 'BTW" comment, so if I want to develop for the iphone how could I not use a spawner and still spawner actors (spawning around 10-30) a level.
Would it be better to put them all outsdie of the screen and delay movement?
Thanks!
Also let me clarify my statement about spawn killing performance. If your doing a lot of spawns at a time, then yes it will hurt performance (like firing bullets for instance). If your just occasionally using it to add an actor, I don't think it will take that big of a toll on your performance. In fact I'm wondering if it might help performance to spawn those actors every once in a while, as opposed to starting the scene with tons & tons of actors. I'll be doing some of those tests myself. and let people know what I find out.
Do you have a iphone/ipod to test on? I think thats the best thing to do. I know when I finally got my ipod touch3G setup with GS, I ended up spending 1/2 week optimizing my rules.