Attempting to make mouse adjust camera angle but it's messing with player control due to camera relativity

Hello!

I’m making a topdown game and wanted to make the camera’s angle change with the mouse position to add a little atmosphere to the game but it’s causing some problems with the character movement since it’s relative to camera by default and I think I saw an option somewhere that makes movement not relative to camera. I assume that’s not what I should do.
Instead, maybe make my own control script?

Please note that I’m holding only the [A] button (Walking to the left)

Any suggestions are appreciated.
Thanks in advance ^-^

I assume that your camera is going to always be at that same base angle, so you could just disable movement being relative to the camera.

I do not know how to disable it. I tried searching and no results related to what i search for

I think I figured out what you have to change,

  1. Fork a copy of the PlayerModule (if you haven’t already) by playing the game like normal, copying the generated one from StarterPlayer.StarterPlayerScripts and pasting it in the same place in studio mode

  2. Go to PlayerModule.ControlModule.BaseCharacterController in the Explorer hierarchy. Open it up, and you should see this function starting on line 17 of the script:

function BaseCharacterController.new()
	local self = setmetatable({}, BaseCharacterController)
	self.enabled = false
	self.moveVector = ZERO_VECTOR3
	self.moveVectorIsCameraRelative = true
	self.isJumping = false
	return self
end
  1. Change self.moveVectorIsCameraRelative to false, and that should fix it.
2 Likes