Reduce side effects of SeparationRayShape2D.slide_on_slope
#13423
WesleyClements
started this conversation in
2D
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've been running into some issues with what seems to me to be an unintuitive design choice for the behavior of
SeparationRayShape2D. From what I can see in the implementation,SeparationRayShape2Dis intended to be used for depenetration and is excluded from the collision detection that would interrupt motion. It seems that the intended way to allow aSeparationRayShape2Dto be used to interrupt motion is by enablingSeparationRayShape2D.slide_on_slope. UnfortunatelySeparationRayShape2D.slide_on_slopeadditionally changes the collision response to not separate exclusively along the ray. You could alternatively setPhysicsTestMotionParameters2D.collide_separation_rayto true but that isn't accessible from inside ofCharacterBody2D. Based on the way it was implemented, it feels likePhysicsTestMotionParameters2D.collide_separation_raywas added to explicitly override this default behavior because the implementation caused problems for floor snapping inCharacterBody2D.With all that in mind I want to pose a couple questions.
SeparationRayShape2Dfrom collision detection that would interrupt motion? I do see that the implementation isn't really robust enough to account for motion accurately. Is that the reason? As far as I can see,SeparationRayShape2Dwould still separate along the direction of the ray even if it interrupted motion.SeparationRayShape2Din this way, wouldn't it be better to changeSeparationRayShape2D.slide_on_slopeto an Enum of the different possibly desired behaviors rather than making assumptions about usage? The names could be better but something like:Generally it is unintuitive for me that
SeparationRayShape2Darbitrarily diverges in behavior from otherShape2D(especially as the default behavior).Beta Was this translation helpful? Give feedback.
All reactions