Player can't walk in straight lines because of camera

Hi!
I’m messing around with cameras and movement again, and I encountered a rather strange bug. Might be an engine bug…
In this demo, the player can enter different boxes (using ZonePlus) which gives them a different camera perspective. However, in certain camera perspectives, the player will walk strangely, in the following methods:

  • not in the cardinal directions (north, east, south, west), and at an angle
  • curving even when only 1 key is pressed

Here’s a video to explain it. It can be seen most prominently in the red and yellow boxes. Ignore the blue and green ones, they are fine.

Clearly, you can see in the red box the player begins to curve a bit. In the yellow box, it’s clear that the player refuses to move in the cardinal directions.
I think I’d need to make a completely custom walk script that will force movement in only the cardinal directions, though it may be quite difficult.

Might be cause humanoid with account to the camera, when looking straight down like that it might be causing some rounding issues that make it not exactly what you have in mind.

2 Likes

Could you elaborate? How can I mitigate these rounding issues?

Using Humanoid.Move you can ignore the camera direction completely, but that might not be exactly what you want.

One way to test if this is actually the cause of the issue might be to have the camera point almost completely down, but not quite. If the issue actually is rounding issues, then having it at a slight angle might provide enough “wiggle room” for it to not cause issues.

1 Like

I tried having it at a slight angle, but it’s still able to move in strange ways.
It may be best to use humanoid:Move(), but how might I implement it to work as an alternative to normal movement?

I have not done a lot of custom movement systems, so I don’t know for sure what the best way of replacing the default method of movement is.

You can use the CFrame of the camera to determine which direction D is in relation to the camera, and you can then use that information and get where D is relative to the humanoid.

1 Like

Alright, thanks a lot for your time!

1 Like

Fixed! I went into the playermodule script > control module > basecharactercontroller > moveVectorIsCameraRelative = FALSE
had to do a lot of digging to find that, lol.
thank you!

1 Like

No problem! Glad your issue has been resolved!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.