Model placing at wrong position

  1. What do you want to achieve?
    I want to teleport the player to the mouse position and then have another ability place a model at their current position after teleporting

  2. What is the issue?
    I have two separate abilities. One teleports player to their mouse.hit.p using Char:MoveTo(Pos) and other places a model using Model.Position = Char.LeftFoot.Position. If I teleport first then use second ability, model is placed at the position I was standing before teleporting, not current one. Both abilities work FINE on their own and this only happens after using teleport first.

--Teleport:
Char:MoveTo(Pos)

-- Second Ability

Wind.Position = Char.LeftFoot.Position

Mouse.Hit is inaccurate, consider using Camera:ScreenPointToRay(mousePosition.X, mousePosition.Y) in order to detect mouse position in the world.

When putting a model at the same position as the player, consider searching for the HumanoidRootPart instead of the LeftFoot, since it would be more reliable that way.

The issue you’re facing with the teleport is probably happening as a result of the script that teleports your model still thinking that the player is at the old position. Consider assuring the player is at the new position before running the ability that teleports a model to the player.

Also keep in mind, when moving a model, do not use Model.Position. That only works for base parts. Use Model:PivotTo()

Let me know if you have any questions or need any assistance!

4 Likes

Thank you! Used RootPart instead of LeftFoot and it seems to be fixed.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.