You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS/device including version:
Linux 64-bit. Unlikely to be different under another OS.
Issue description:
The player sprite uses a Raycast2D to detect the angle of the floor underneath it (PlayerPivot). It also has this code:
(to disable when in the air):
if ($PlayerPivot.enabled): # If in the air and the pivot/floor edge detectors are enabled, disable them.
$PlayerPivot.enabled = false
$FloorEdgeLeft.enabled = false
$FloorEdgeRight.enabled = false
rotation = 0 # Avoid the player character being at odd angles when in the air and returning to the ground.
(to enable when on the floor, and check/change rotation angle):
if (!$"PlayerPivot".enabled): # If on the ground and the pivot/floor edge detectors are not enabled, enable them.
$"PlayerPivot".enabled = true
$"FloorEdgeLeft".enabled = true
$"FloorEdgeRight".enabled = true
else: # Make sure the player is angled to the ground.
ground_normal = $"PlayerPivot".get_collision_normal ()
ground_angle = (floor_normal.angle_to (ground_normal))
rotation = (rotation if player_speed < 0.05 else ground_angle)
This usually works as expected - the player sprite "follows" the angle of the floor underneath it. But sometimes, for reasons not entirely clear, sometimes the sprite will flip (usually by 90 degrees, but I've noticed other angles too). It seems to do this especially when having stopped mid-way on a slope and started to run up or down it, or running off the end of a slope and landing on a higher platform. This appears to be completely at random and is not reliably reproducible as far as I have determined.
I am looking at using the collision info for the player sprite's collision shape directly instead of a Raycast, but I'm not sure if I'd still run into the same problem. I'm also not 100% sure this isn't my error.
Lots of sanity checking is likely to be needed before more of the issues
that are happening entirely at random (seemingly) can be fixed. There may
be Godot bugs involved.
godotengine/godot#25759
Prevented super-powered jumping (I think) that can sometimes happen by
jumping when running up a slope (or if velocity.y is non-zero).
Signed-off-by: Stuart "Sslaxx" Moore <[email protected]>
If you're not having any issues with the vector signs juggling for a frame, then it could be related to this: #21020
I had issues with sprites when dealing with rotation and trying to use (-1, 1) scaling for mirroring. It doesn't seem to return what you would expect with certain rotations when you have inverted scaling.
So far, using the version of Sonic Outbreak (the project I reported this issue as happening in) from #24050 (comment) with 3.2.2 I haven't noticed this issue.
I have noticed that jumping when moving no longer triggers the appropriate animation (when it did before) and incorrect jumping distances/speeds. Unsure at this stage if it's a bug in my code exposed by 3.2.2 (more likely), or a bug in 3.2.2.
Godot version:
3.1 beta3.
OS/device including version:
Linux 64-bit. Unlikely to be different under another OS.
Issue description:
The player sprite uses a
Raycast2D
to detect the angle of the floor underneath it (PlayerPivot
). It also has this code:(to disable when in the air):
(to enable when on the floor, and check/change rotation angle):
This usually works as expected - the player sprite "follows" the angle of the floor underneath it. But sometimes, for reasons not entirely clear, sometimes the sprite will flip (usually by 90 degrees, but I've noticed other angles too). It seems to do this especially when having stopped mid-way on a slope and started to run up or down it, or running off the end of a slope and landing on a higher platform. This appears to be completely at random and is not reliably reproducible as far as I have determined.
I am looking at using the collision info for the player sprite's collision shape directly instead of a Raycast, but I'm not sure if I'd still run into the same problem. I'm also not 100% sure this isn't my error.
Minimal reproduction project:
Sslaxx/Sonic_Outbreak@1ab26ed (https://github.com/Sslaxx/Sonic_Outbreak/tree/godot_sonic_engine)
The text was updated successfully, but these errors were encountered: