This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

I see 3 potential options:

a) Make use of simple custom physics, while manually using shape collision functions, and checking if entities are on the same Y plane (more like an interval of Y values). But all those pre-built physics of Godot cannot be used, and they are very handy.

b) Hack around with Godot's physics. Is there a way it would work? For example, how to still have the auto collision detection and resolution taking place by using kinematic/rigid/static bodies, but only if the elements are on the same Y plane?

c) Use 3D space + Orthogonal Projection + 2D elements. I made a basic scene, though I could not have the camera looking "right" and... well it's 3D, more complicated I guess, and there isn't as much documentation.

Are any of those options doable? Are there other ways?

edit: I am mentioning physics quite a bit, but I actually wanted to mean auto collision detection and resolution of using PhysicsBody2D (like a Kinematic or Static body) nodes.

in Engine by (388 points)
edited by

2 Answers

0 votes

Why would you want simulated physics for a game like Streets of Rage? Maybe I don't know your game design well enough and it's actually a lot less like Streets of Rage than I think, but for a game like the original I would never use simulated physics. All you are interested in are collisions so you know who has been hit. For the rest I would suggest animations or Tweens.

by (1,124 points)

Yes, it's not the physics itself, but the collision detection and resolution.
It is nice to use kinematic bodies (for example) for the player and enemies, and static bodies for other things in the level, and just like that the player will never pass through enemies, etc.
I started imagining more complex levels and that pre-built collision detection/resolution seems very helpful.

+1 vote

Take a look at the collision layer and mask system.
I think all you have to do is have different collision layers and set them on your Bodies depending on their position on screen.

by (922 points)

Thanks! I did not know about the collision layer and mask system.
I was trying and it already and seems like a great option to consider for this case as well as for other situations.

It does have one small quirk: moving from top/bottom to another shape + both shapes are overlapping + it is time to make collision layers and masks "match" to trigger collision -> causes moving body to instantly move to the left or right to solve the collision - at least for similar shape bodies. Though weird the first time I saw it, kind of makes sense.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.