function love.update(dt)
body:setLinearVelocity(800, 800)
world:update(dt)
print(body:getLinearVelocity())
end
My terminal is full of ... zeros This seems not logic...
But I'm new here, I don't seriously know how to do something with LÖVE so my problem may be very stupid...
local world, body, shape, fixture
function love.load()
world = love.physics.newWorld(0, 0)
body = love.physics.newBody(world, 400, 300, "dynamic")
shape = love.physics.newCircleShape(5)
fixture = love.physics.newFixture(body, shape)
end
function love.update(dt)
body:setLinearVelocity(800, 800)
world:update(dt)
print(body:getLinearVelocity())
end
Ok my bad. As i guessed, it was a very very stupid error : I didn't notice I was supposed to use quotes in the declaration of the new body...
Now it works for me to, thank
Sure. Notice how the problem wasn't in the snippet you posted. That's why it's important to provide a full example demonstrating a problem if you're asking for help. Doing so the next time you ask will help us help you.