How would i detect collison between a player and object using box2d
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How would i detect collison between a player and object using box2d
Hello I am currently making a game for my class and I was wondering how I would detect Collison between a Player and object using box2d. I would also wondering how you could spawn the object that the player collided with in a random location on the tiled map through the lenses of a camera.
Re: How would i detect collison between a player and object using box2d
Just from documentation:l0ki77 wrote: ↑Sat Apr 29, 2023 1:29 am Hello I am currently making a game for my class and I was wondering how I would detect Collison between a Player and object using box2d. I would also wondering how you could spawn the object that the player collided with in a random location on the tiled map through the lenses of a camera.
Code: Select all
if playerFixture:isTouching(objectFixture) then
or
https://love2d.org/wiki/World:queryBoundingBox
Re: How would i detect collison between a player and object using box2d
Use contacts: https://love2d.org/wiki/Contact
Specifically create callbacks:
https://love2d.org/wiki/World:setCallbacks
I *would not* recommend using functions mentioned above as the documentation states they are not recommended and might miss collisions.
Specifically create callbacks:
https://love2d.org/wiki/World:setCallbacks
I *would not* recommend using functions mentioned above as the documentation states they are not recommended and might miss collisions.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 5 guests