hey y'all.
i'm messing around with the love.physics module or whatever, and im using the body:istouching function to determine whether or not the player controller can jump. however, this only works with one body at a time. is there any way to using the body:istouching function on a table or group of bodies so that i can easily add in new walls and stuff?
sorry if this is really shittily worded, im new to posting on this forum.
how to use body:isTouching with multiple objects?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: how to use body:isTouching with multiple objects?
It's not clear to me what you're asking.
You want to check istouching to check if a player can jump?
Or to add walls and stuff?
Anyway, this is on the wiki:
You have to cycle through all bodies, I guess, and see which one(s) are touching the player.
You want to check istouching to check if a player can jump?
Or to add walls and stuff?
Anyway, this is on the wiki:
Code: Select all
touching = Body:isTouching( otherbody )
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/pad-and-pencil-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/pad-and-pencil-gridiron
Re: how to use body:isTouching with multiple objects?
I don't think that's the right technique for the job. I would use the beginContact and endContact callbacks, and keep track of the touching bodies yourself. I think that makes more sense than trying to make a list of bodies yourself to check with isTouching().
Or you could use World:rayCast or World:queryBoundingBox.
Or you could use World:rayCast or World:queryBoundingBox.
Who is online
Users browsing this forum: No registered users and 8 guests