Right now I am having an issue where my character is colliding with this fixture, which then essentially "sinks" my character into the ground. Can anyone please try my game and just jump around and hit your head on the bottom of the ledges (that's the fixture locations). You might have to try it a couple of times on the different ledges, but it will happen.
As you can see, the sprite starts off fine, but then will sink into the ground. Please help..
See my attached files. (4)
P.S. Can anyone reiterate on what the "setUserData()" does, and if it can change the data, or be the culprit here somehow? (Is it basically just like a tag/identifier, and nothing else?)
P.S. And yes, I tried to draw the pig at the top of this page.
[SOLVED] Player Sinks Into Ground After Collision
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[SOLVED] Player Sinks Into Ground After Collision
- Attachments
-
- main.lua
- (9.56 KiB) Downloaded 93 times
Last edited by i_love_u on Sat Dec 06, 2014 7:51 pm, edited 2 times in total.
Re: fixture:setUserData()
First off, the user data can be anything. It's just a reference that you can set to whatever info you want the fixture to have, in order for you to be able to distinguish between them in the callbacks. It can be a string, or a table or an instance of a class that you wrote.
Second, you should use Azhukar's physics debug method to see what happens with your shapes when you jump around. viewtopic.php?f=5&t=77140
I'm uploading a modified version of your love that uses this debug method. Run it and see what the problem is
Second, you should use Azhukar's physics debug method to see what happens with your shapes when you jump around. viewtopic.php?f=5&t=77140
I'm uploading a modified version of your love that uses this debug method. Run it and see what the problem is
- Attachments
-
- main.lua
- (12.26 KiB) Downloaded 95 times
Re: Player Sinks Into Ground After Collision
Try this example and see if you can understand how to make it work.
http://love2d.org/forums/viewtopic.php?f=5&t=79243
http://love2d.org/forums/viewtopic.php?f=5&t=79243
Re: Player Sinks Into Ground After Collision
Thanks, it was the actual rotation of my shape, and that script helped me visualize it. I fixed it by adding this line of code:
Code: Select all
player.body:setFixedRotation(true)
Re: [SOLVED] Player Sinks Into Ground After Collision
this has nothing to do with the question, all i wanted to mention is that you are missing the nose holes on the pig
Re: [SOLVED] Player Sinks Into Ground After Collision
Hehe, and mine doesn't look fat enough like the one there. LOLDoctory wrote:this has nothing to do with the question, all i wanted to mention is that you are missing the nose holes on the pig
Who is online
Users browsing this forum: Bing [Bot] and 9 guests