When I touch this part, I want the player to face the same direction as the forward face of the part, but at the moment it’s rotation me backwards
-- Rotate character to face water
local Goal = {
CFrame = CFrame.new(
Character.HumanoidRootPart.Position,
Vector3.new(
fishingSpot.PrimaryPart.Position.X,
Character.HumanoidRootPart.Position.Y,
fishingSpot.PrimaryPart.Position.Y
)
)
}
local Tween = TweenService:Create(Character.HumanoidRootPart, TweenInfo.new(), Goal)
Tween:Play()
3 Likes
Not too sure if what I’m saying is helpful in any capacity, but just for the sake of clarification: is it intentional that you’re feeding a Y coordinate to where a Z coordinate is expected? That goes for your lookAt argument where the third number of the vector (Z) is being given a Y.
Vector3.new(
fishingSpot.PrimaryPart.Position.X,
Character.HumanoidRootPart.Position.Y,
fishingSpot.PrimaryPart.Position.Y -- This says Y, not Z
)
2 Likes
Hmm I thought that fixed it, but it’s still kinda acting odd
It rotates the character, but at like strange angles
1 Like
This should work, im not too sure why else it would be acting funky. I changed a few things from the original;
Goal = {
CFrame = CFrame.new(Character.PrimaryPart.CFrame.p, Vector3.new(fishingSpot.PrimaryPart.Position.X, Character.PrimaryPart.Position.Y, fishingSpot.PrimaryPart.Position.Z))
}
local Tween = TweenService:Create(Character.PrimaryPart, TweenInfo.new(), Goal)
Tween:Play()
The only other thing I can think of is the red part has collisions on.
1 Like
Still doesn’t work
Front facing side
Character rotation
Still slightly rotated
Not sure what you mean but collisions on tho?
2 Likes
Just maybe this is because the player is too close to the position, so it creates a weird effect.
Maybe try offsetting the look at position a few studs in front it by multiplying it with a CFrame, then using the position component of that.
Not sure if that’d help at all, but it might be worth a shot.
How would I do that?
30 char 30 char
1 Like
Something among the lines of-
local target_CF = fishingSpot.CFrame * CFrame.new(0, 0, 5) --//Might need to be negative Z
local root_CF = Character.HumanoidRootPart.CFrame
Character.HumanoidRootPart.CFrame = CFrame.new(root_CF.p, Vector3.new(target_CF.X, root_CF.p.Y, target_CF.Z)
1 Like