I'm trying to create a dash for my game, so when the camera is facing the back of the camera and the player is holding S, the character dashes back, however if the camera is looking at the front of the character and the character is holding S, ill need the character to dash forward.
local DashEvent = game:GetService("ReplicatedStorage").Remotes.DashEvent local LastDash = tick()-4 DashEvent.OnServerEvent:Connect(function(Player,CLookVector,CRightVector) local CanDash = math.abs(tick()-LastDash) if CanDash > 2 and Player.Character and Player.Character.HumanoidRootPart then LastDash = tick() local BodyVelocity = Instance.new("BodyVelocity",Player.Character.HumanoidRootPart) BodyVelocity.MaxForce = Vector3.new(math.huge,0,math.huge) BodyVelocity.Velocity = CLookVector*-30 game.Debris:AddItem(BodyVelocity,.2) end end)
Thanks!