Teleporting player to another player doesn't get exact position when the target player is moving/falling etc

Hello so im trying to teleport a player to another player for an ability for my game. The problem is, when the target player is moving or falling or something, the teleport position isnt exactly where the target is. Im not sure why.

Things ive tried:

  • Anchoring target before teleporting
  • trying to teleport to different body parts

What i want:

  • I want to player to teleport to the exact position of the target whether they are moving or not so that animations look nice and are connected properly.
1 Like

The reason the position where the player teleport is not exact is due to lag . There is not really any easy way to fix it other than predicting the position.

  1. You take the target current position
  2. you take the target velocity
  3. You add the position with the velocity * factor

factor should be a fraction weather whole number or not depends on your liking. You can keep tweaking the factor until it is accurate

so basically

Target.HumanoidRootPart.Position + Velocity * 4/2

or smth like that?

yea but the fraction can decimals like 0.5,1.2 ect

1 Like
ChoosenPlayer.HumanoidRootPart.Position + ChoosenPlayer.HumanoidRootPart.AssemblyLinearVelocity * 1/2

i tried this and i think it made it even worse

is it teleporting the player too front or too back? If it is too front ,decrease the factor to around 0.1 .

its telporting too under the player. the other player is falling at this time.

ChoosenPlayer.HumanoidRootPart.Position - ChoosenPlayer.HumanoidRootPart.AssemblyLinearVelocity * 1/6

this ended up working perfectly, thanks

i just change it to subtract instead of add

1 Like

This is just a personal preference but you I would change the factor to a negative instead

1 Like

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