Please help request!
![Awww :3](./images/smilies/ms-three.png)
As the title says, i need a object having a constant speed in the X axis!
I leave an attachment example.
Constant speed cube would have to be 480, but no.
I hope you help me!
![I'M SO HAPPY I COULD SHIT A RAINBOW RIGHT NOW :awesome:](./images/smilies/ms-awesome.png)
Code: Select all
love.update(dt)
object.x = object.x + distancePerSecond * dt
object.y = 500
end
try your code, this is the result.Beelz wrote:Not getting into collisions... This will move you along at a constant rate:Code: Select all
love.update(dt) object.x = object.x + distancePerSecond * dt object.y = 500 end
it can be improved? Thanks!
Code: Select all
love.update(dt)
local lvx, lvy = object:getLinearVelocity()
object:setLinearVelocity(10, lvy)
end
Thanks, but I want to respect collisions!ivan wrote:If you don't want your body to respond to collisions but move at a constant rate you can make it a "kinematic" body and set its velocity.
Kinematic bodies push other objects but do not respond to collisions themselves.
it can be improved? Thanks!Code: Select all
love.update(dt) local lvx, lvy = object:getLinearVelocity() object:setLinearVelocity(10, lvy) end
Not really, he just needs to do a few things every frame:Doctory wrote:switch from the love.physics, it is impossible to get a constant velocity in love.physics without screwing something up
1.you set the linear velocityZ_ReC wrote:This respects the collision, but no speed!![]()
Users browsing this forum: Google [Bot] and 4 guests