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

(SOLVED)How do I create a vector 3 that orientates from the characters look?

Asked by 4 years ago
Edited 4 years ago

Sorry for any English mistakes. I'm trying to do a LongJump script. The script is working but using the CFrame.LookVector doesn't work really well. I tried using the Vector 3 and Cframe,but because I'm really bad at doing it I don't know how to create a Vector 3 that is orientated by where the player is looking.

the Long Jump script.

function LongJump()
    if CR and debounce2 then
        CR = false
        AP = true
        animTrackLongJump:Play()
        if animTrackroll.IsPlaying then
            animTrackroll:Stop()
        end
        debounce2 = false
        humanoid.JumpPower = 20
        humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
        print("longjump")
     local Root = localPlayer.character:WaitForChild("HumanoidRootPart")
        Root.Velocity =Root.Cframe.LookVector*(30+humanoid.WalkSpeed*2)
        repeat wait() 
            animTrackLongJump:Play()
            animTrackLongJump.TimePosition = 0.100 
        until humanoid:GetState()== Enum.HumanoidStateType.Landed
        or humanoid:GetState() == Enum.HumanoidStateType.Jumping
        animTrackLongJump:Stop()
        humanoid.JumpPower = 50
        debounce2 = true
        end
        end
0
Vector3 + Vector3 OnaKat 444 — 4y
0
I tried using the lookvector + vector.new (0,1,2) but the problem is that doing this make that the long jump only goes in one direction. extroias 16 — 4y
0
Now I undertood how to use the RootDirections,I did the lookvector + the up vector and multiplied the lookvector by 1.5 and the up vector by 0.5 extroias 16 — 4y

Answer this question