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

Why does this lookVector work wrong?

Asked by 8 years ago
    mainbrick.Material = "Ice"
    mainbrick.BrickColor = BrickColor.new("Light blue")
    mainbrick.Reflectance = 0.15
    mainbrick.Size = Vector3.new(mainSX, 0.6, mainSY)
    mainbrick.Position = char.Torso.CFrame.lookVector * 10

I want to make the part appear infront of the character and close enough to it, and also make it so it's angled. And it doesn't do it, it doesn't respect the lookVector when u spawn it, it kinda spawns it wherever he wants, and I don't know how to make the part spawn angled when the character's torso is in diagonal angle.

It is doing an animation while trying to spawn the brick

1 answer

Log in to vote
0
Answered by
Link150 1355 Badge of Merit Moderation Voter
8 years ago

The lookVector is probably not normalized by default; It points to a specific point in space instead of being a unit vector, so its components can have any value. Since its components are World Space coordinates, the multiplication by 10 makes it go 10 times farther than that of the point it points to (instead of going 10 studs in it's direction). Try using char.Torso.CFrame.lookVector.Unit instead and see if that works.

0
It doesn't lookVector anywhere, the part spawns only at 1 place. iDarkGames 483 — 8y
Ad

Answer this question