-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no way to set one-way collision directions #12791
Comments
It's currently the way it is for simplicity, you can rotate the shape
though, as this option is now per shape.
…On Thu, Nov 9, 2017 at 8:33 PM, Tim Schellenberg ***@***.***> wrote:
*Operating system or device, Godot version, GPU Model and driver (if
graphics related):*
Windows 10 (x64), Godot 3 Alpha 2
*Issue description:*
In Godot 2.x, one-way collision was exposed in the form of a direction
vector and a number for the maximum depth inside the body, which was great
and fully customizable.
In Godot 3, all that is replaced with a boolean checkbox. Enabling it will
make the shape only collide from the top, with no way to change this, at
least none are exposed in the editor or outlined in any documentation for
code. It always points up.
When the body rotates then this direction changes with the rotation just
fine, meaning it can handle rotating the direction it's solid from.
Is there a reason the directional setting was removed?
As an aside, the documentation for CollisionShape2D's one_way_collision
<http://docs.godotengine.org/en/latest/classes/class_collisionshape2d.html?highlight=collisionshape2d#member-variables>
member states that you can somehow choose top or bottom, but it is always
only solid from the top.
Which, by the way, is strange because the giant arrow that is drawn in the
editor window always points down.
*Steps to reproduce:*
1. Create any CollisionShape2D, CollisionPolygon2D or TileSet tile
with One Way Collision enabled.
2. Struggle to find a way to change the direction it is solid from.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#12791>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z29S0EPoQjFUs4NG9XrAorwv8luNCks5s04vcgaJpZM4QY10P>
.
|
Would performance take a hit from re-adding a way to set the direction for each shape? I'd mostly prefer not to have to rotate everything because when I programmatically create polygons, having to rotate the location of every vertex each time just to counteract the rotation I'll have to give the shape to set the one-way direction is time consuming. And having to misalign the collision objects in Tiled on purpose to account for the rotation that will be applied, unless I want to actually rewrite the importer for this, isn't ideal either. Which I think is a bit of a heavy expectation for something that used to be possible pretty easily? I suppose it depends on how heavy on the processing implementing this would be, but given that one-way directions are generally not even enabled on the majority of shapes I can't imagine this being a terrible processing sink. |
I was thinking of adding a one way collision rotation to Shape, this may be
a bit better and easier than the previous system.
Still, there are many more priorities over doing this. If you want to give
it a try I can point you to the right places in the source code.
…On Thu, Nov 9, 2017 at 11:18 PM, Tim Schellenberg ***@***.***> wrote:
Would performance take a hit from re-adding a way to set the direction for
each shape?
I'd mostly prefer not to have to rotate everything because when I
programmatically create polygons, having to rotate the location of every
vertex each time just to counteract the rotation I'll have to give the
shape to set the one-way direction, as well as having to misalign the
collision objects in Tiled on purpose to account for the rotation that will
be applied, unless I want to actually rewrite the importer for this.
Which I think is a bit of a heavy expectation for something that used to
be possible pretty easily? I suppose it depends on how heavy on the
processing implementing this would be, but given that one-way directions
are generally not even enabled on the majority of shapes I can't imagine
this being a terrible processing sink.
But that's coming from someone with very little clue of how this is
actually implemented, if there's solid reasons that speak against this then
I'll have to accept that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12791 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF-Z291ahG_m5mrjt9ATKR5-rC9swk88ks5s07J1gaJpZM4QY10P>
.
|
I can give it a try, sure. Can't promise I'll have results because I've never looked deeper than a method or two into the source and am not terribly well versed in the language, but I understand that there's more important things with the release of 3.0 approaching (missing features, bugs, what have you). If anyone else thinks they can handle it then don't let me trying to look into it deter you though! |
Rotating and/or having more than one (rotated) shape and disabling now should work, I liked the old way though, it was easy to modify on the script side. |
rotating a tile with one way collision in tilemap does not rotate the one way collision in 3.0.2. Would be nice to have the option of choosing direction, maybe even multiple directions? E.g. collision in vertical movement, but no collision in horizontal movement |
@fossegutten there is already an issue opened about tilemaps and 1 side (which has many problems), multiple directions can be achieved with multiple shapes, won't work on tilemap, though. |
Hey guys, I'm testing the rotation for the shape to set the |
Hi there, 👋🏻 I'm new to Godot and I'm using version 4.1.2 and I stumbled upon this discussion here while searching for a description on how to use the "One Way Collision" checkbox in the Inspector. Unfortunately, the docs don't describe that in detail, but I'll open a PR to add 1-2 describing sentences in the docs in parallel in a sec... 📝 Apart from that, I believe that the big red arrow in the 2D View Editor is pointing in the wrong direction and should be inverted. 🤔 When I activate the "One Way Collision" checkbox on a CollisionShape2D the big red arrow points downwards in the 2D View Editor (rotation of shape is 0°). If I rotate the CollisionShape2D by 180°, the big red arrow then shows upwards. So, default seems to be pointing downwards. Ok so far... The issue is that when I use this CollisionShape2D in a GD script to disable the collision shape for a certain amount of time (collision shape is the edge of the grass on the ground, enemy is getting spawned inside/behind grass before flying upwards and then the collision shape is enabled again), the enemy velocity bounce is exactly inverted from what I would expect, meaning to the opposite direction in which the big red arrow shows in the 2D View Editor... 😢 🤔 Could you please have a look into this as it's quite confusing for new Godot users like me... 😆 😞 |
Please open an issue or ask in some of the other community channels, this has been closed for five years and isn't the place to ask this |
Operating system or device, Godot version, GPU Model and driver (if graphics related):
Windows 10 (x64), Godot 3 Alpha 2
Issue description:
In Godot 2.x, one-way collision was exposed in the form of a direction vector and a number for the maximum depth inside the body, which was great and fully customizable.
In Godot 3, all that is replaced with a boolean checkbox. Enabling it will make the shape only collide from the top, with no way to change this, at least none are exposed in the editor or outlined in any documentation for code. It always points up.
When the body rotates then this direction changes with the rotation just fine, meaning it can handle rotating the direction it's solid from.
Is there a reason the directional setting was removed?
As an aside, the documentation for
CollisionShape2D
's one_way_collision member states that you can somehow choose top or bottom, but it is always only solid from the top.Which, by the way, is strange because the giant arrow that is drawn in the editor window always points down.
Steps to reproduce:
CollisionShape2D
,CollisionPolygon2D
orTileSet
tile withOne Way Collision
enabled.The text was updated successfully, but these errors were encountered: