I'm hoping there is a simple answer to this,
Using love.physics, I have two bodies in my game: a player, and a platform. I want to make it so the player can only jump when the platform is beneath him. What is the best way to verify that the platform's collider is right beneath the player's?
Physics - How to tell if standing on a platform?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 6
- Joined: Sun Mar 20, 2016 5:11 pm
Re: Physics - How to tell if standing on a platform?
The most reliable way I have found is to check if the player is being "pushed" along the axis of gravity:
http://2dengine.com/doc/gs_physics6.html
http://2dengine.com/doc/gs_physics6.html
Re: Physics - How to tell if standing on a platform?
Oh wow. That is a fantastic guide!ivan wrote: ↑Wed Jul 05, 2017 4:48 am The most reliable way I have found is to check if the player is being "pushed" along the axis of gravity:
http://2dengine.com/doc/gs_physics6.html
Not my question but thanks a lot!
Re: Physics - How to tell if standing on a platform?
Your question is re-stated and answered in the article as:
"Is the body pushed along an axis?"
Unfortunately, the example code is not designed for Love2D,
but you can easily write your own version using "body:GetContactList()".
Re: Physics - How to tell if standing on a platform?
Haha. My friend. I meant this literally wasn't my question. As in not my thread
Just think that page is fantastic.
-
- Prole
- Posts: 6
- Joined: Sun Mar 20, 2016 5:11 pm
Re: Physics - How to tell if standing on a platform?
Thanks for the responses! That article is really helpful, I'll give it a shot.
Who is online
Users browsing this forum: Google [Bot] and 2 guests