Can only roll in 2 directions?

I am currently working on a movement system, everything it has is pretty simple, or done in a very simple way, how I tackled Rolling was with a body velocity effect, in theory you just press the button and are propelled the direction that you are facing, and the animation plays

I thought it should be pretty straight forward, but there must be a huge oversight cause I can only roll north and south relative to the server (local script), and I’ve no idea why

I found a lot of people saying use Humanoid MoveDirection and I tried doing that in a few different ways and it was the same end result

I also grabbed all the lines of code that were needed to use the roll function and nothing else, so its testable in studio by simply making a startercharacterscript

local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

local RollForce = Vector3.new(0, 0, 150)
local RollCooldown = 2
local CanRoll = true

local function Roll(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.Q then
		if gameProcessedEvent or not CanRoll then
			return
		end
		HumanoidRootPart.Velocity = HumanoidRootPart.CFrame.LookVector * RollForce

		CanRoll = false
		wait(RollCooldown)
		CanRoll = true
	end
end

UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	Roll(input, gameProcessedEvent)
end)

guarantee I did something horribly wrong and the fact that a lot of people were able to use movedirection and have it work but I’m not makes me feel incredibly stupid so sorry

Have you tried something like this for RollForce?

-- Like this:
RollForce = Vector3.new(150,150,150)

This is more of a guess than anything, just lmk!

EDIT: Just realised I messed up.

EDIT: (again): Just tested a different solution! It worked, try the above code.

1 Like

sometimes I question why I do what I do

1 Like

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