Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make LookVector follow the Player Camera?

Asked by 4 years ago

Right below is the Code, what function would I add for LookVector to follow the player's camera?

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local DashEvent = ReplicatedStorage.Remote.RemoteEvent.Game.DashEvent

DashEvent.OnServerEvent:Connect(function(Player, Camera)
    local Animation = Instance.new("Animation")
    Animation.AnimationId = "rbxassetid://2966733565"
    local LoadAnimation = Player.Character.Humanoid:LoadAnimation(Animation)
    LoadAnimation:Play()

    local Humanoid = Player.Character.Humanoid
    Humanoid.AutoRotate = false
    Humanoid.JumpPower = 0

    local Position = Instance.new("BodyVelocity", Player.Character.HumanoidRootPart)
    Position.MaxForce = Vector3.new(10000, 0, 10000)
    Position.P = 100
    Position.Velocity = Player.Character.HumanoidRootPart.CFrame.LookVector * 90
    game.Debris:AddItem(Position, 0.75)

    wait(0.75)
    Humanoid.AutoRotate = true
    Humanoid.JumpPower = 50
end)
0
What exactly do you mean by make the "LookVector to follow the player's camera". LookVector is a read-only property of CFrame; it can't be changed LukeSmasher 619 — 4y
0
LookVector is the direction that a part is facing. It cannot be changed, it can only be read. SCP774 191 — 4y
0
what are you talking about Optikk 499 — 4y

Answer this question