If I try moving myself to my torso look vector or try tweening it (even with a * 1 and stuff) it takes me to the center of the map, any fixes?
Add the torso position to get the end position
What do you mean? I’m trying to make the player go 10 studs where ever they’re looking.
Its this to get the end position.
local endPos = torso.Position + torso.CFrame.LookVector*10
Tweening is normally position to position.
If you put a direction as a position value like LookVector it will lead to the center of the map.
Like @dthecoolest said, the lookvector is a unit vector. This means it has no positional value and is for direction only.
The best way is to add the position to the vector to get what you want.
Question, how do I make the character keep the direction they were facing?
You can use cframe of the torso
Torso.CFrame *= CFrame.new(0, 0, -distance)
Yes this is my code.
local Pos = character.Torso.Position + Character.Torso.CFrame.LookVector * 10
character.Torso.CFrame = CFrame.new(Pos)
The code below already brings the player 10 studs at where they’re looking at.
Just a recommendation to shorten the code
character.Torso.CFrame *= CFrame.new(0,0, -10)
So instead of -10 use positive 10.
But, this doesn’t look like it’s using LookVector, I think this might only make them go left? idk.
Negative Z coordinate of the torso in object space is where the torso’s cframe is looking at
Correction: It will make them go forwards. Left is the negative X axis and right is the positive X axis.
Torso.CFrame = Torso.CFrame + Torso.CFarme.LookVector * 10
*Torso.CFrame += Torso.CFarme.LookVector * 10
You realize, I write it out like that, because I don’t know the skill level of the OP, so I want my answer to be as understandable as possible.
If the OP knows how to use +=, ++ *= etc… they can condense on their own.
Sometimes readability is more important that showing off.