Hi all, thanks for any help-
I’m moving over from Unity and JavaScript, having a lot more trouble than expected, sadly.
Essentially, I’d like to have some objects randomly spawn near the top of the screen, rotate themselves to “point” towards a target object (the player, naturally), and then move towards that target at a set speed per second (not per frame!). The player will not move, so these objects only need to calculate an initial orientation, and then move forward till they hit the player, and then trigger an event.
Now, in JS, I would do something like:
Function SpawnEnemy()
{
newEnemy = Object.Instantiate(enemyPrefab, someX, someY);
newEnemy.LookAt(thePlayer);
allEnemies.Add(newEnemy);
}
Function Update()
{
for (theEnemy in allEnemies)
{
transform.translate(enemySpeed * Time.deltaTime);
}
}
Simple enough to me there, but I’m really hitting a brick wall trying to get this working in Lua/Corona.
I’d really appreciate any pointers on this, thank you much! [import]uid: 69255 topic_id: 11238 reply_id: 311238[/import]