Hi all,
I am a complete Newb so please bare with me.
I’m working through the 3rd Tutorial, on Movement. All was well and good until the introduction of Acceleration. I am pretty sure I have followed the instruction well.
The update function looks like this:
function update(self, dt)
if vmath.length_sqr(self.input) > 1 then
self.input = vmath.normalize(self.input)
end
local acceleration = self.input * 200
local dv = acceleration * dt
local v0 = self.velocity
--error occurs on next line
local v1 = self.velocity + dv
--error occurs on previous line
local movement = (v0 + v1) * dt * 0.5
local p = go.get_position()
go.set_position(p + movement)
self.velocity = v1
self.input = vmath.vector3()
end
I get an error message that reads:
ERROR:SCRIPT: main/spaceship.script:15: bad argument #1 to ‘__add’ (vector3 expected, got function)
stack traceback:
[C]
in function __add
main/spaceship.script:15: in function <main/spaceship.script:7>
What am I doing wrong?
Any help will be greatly appreciated.
Thank you all.
Regards
Frank