Files
evol-assets/scripts/demo/spawnpoint.lua
T
2021-07-25 10:48:35 +02:00

12 lines
300 B
Lua

this.shootForce = 600
this.on_update = function()
if Input.getKeyJustPressed(Input.KeyCode.P) then
spawn = loadPrefab('prefabs://DamagedHelmet.pf')
spawn.position = this.worldPosition
rb = spawn:getComponent(Rigidbody)
rb:addForce(Vec3:new(-1, -2, 1) * this.shootForce)
end
end