But at some angle, the player is going literally into the platform. I’ve changed collision object of a hero to be a sphere - that helped a litlle bit, but still he can stuck. How can we make him going up the inclined plane basing on collisions?
I have a strange problem: when the player’s GO is hitting an inclined platform its sprite tilts and unfortunately expands on X axis
Then, when it goes down on a horizontal ground, the sprite tilts back, but the scale on X is still the same, so again, when going up the inclined slope the sprite tilts again and stretches even more, so after a couple times it looks like this:
This sounds really really weird. You’re using kinematic collision objects right? There should be no modification of scale or rotation. The fact that the entire game object rotates seems to indicate the use of a dynamic collision object that has some angular velocity applied.
I gave it another chance and started from scratch with platypus-slopes branch. The difference between an old project was, that I used dynamic collision object, additionally. Removing this redundancy helped to avoid this strange stretch.
Yes, regarding the inclined slopes A player can move up and down on slopes up to 45 degrees. As long as I tested, I didn’t found any weird situation, so we can assume it’s working.
Though, in your example from that branch there is another problem that I can’t figure out how to debug - it looks like the player stops every few meters. Changing its collision shape to a sphere helps avoid this, but in that case the problem with falling into the slope is appearing again
I’m using box shape and in my case, the problem with stopping doesn’t appear, so I started to look into controls.
It’s probably small gaps in the tilemap collision shape that we generate. This is a known problem and something not so easy to solve. Using a sphere will hide this problem. I’m able to avoid it while still using a box in the example project shipped with Platypus. I wonder what the difference is with your project?
Hmm, as I see, platforms in this example are not tilemaps - each of them has its collision object.
I just downloaded your project from the github today, but from slopes branch. In my project there are identical platforms - I use collision objects just like in the example, except I have them Static. (Changing it in your example still didn’t help)
Box collision object behavior:
Sphere collision object behavior:
Aaand there is a behavior without any collision object at all:
This is really weird. Everything works perfectly for me. I wonder if it’s an FPS thing and the physics not running with a sufficiently short timestep. I’ll experiment a bit tonight.
Man, no need to make it at night, it’s not so urgent I could check something for you, what do you need? For me the strangest thing is that it work without any collisionobject, but looking into the platypus module it seems legit, I’m trying to understand it more
I pulled both master and slopes branches today, tried it, and the results are the same as I showed above I’m using 1.2.148, but will update right now. Laptop is HP Elitebook 840 G5 with Windows 10 64-bit.
EDIT: and tested both on 1.2.149, still the player can stop
I’m playing with the excellent Platypus now trying to get it to work with sloped Tilemap terrain. When applying a steady instance.down() impulse I get this result:
Edit: Only using instance.right() results in the player getting stuck on tilemaps seams:
Is it possible to make Tilemap slopes work with Platypus?