1
\$\begingroup\$

In Vavio, how do you make an enemy aim at the player then shoot a bullet? Here's the code I tried:

LevelSpawnData/spawnData-L0.json

{
"spawns": [
    {
      "time": 3.2,
      "leave": 12.8,
      "pattern": "Test/aim.lua",
      "movement": "Test/move.lua",
      "model": "circle",
      "material": "red",
      "x": 0.5
    }
  ]
}

Patterns/BulletSpawning/Test/aim.lua

bullet = pattern.NewBullet()
bullet.speed = 3
bullet.angle = ??? -- Want to set this to angle towards player
pattern.SpawnBullet(bullet)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.