#Cframe tp issue (Y)
1 messages · Page 1 of 1 (latest)
Yep
The second script is a loop to show y position
do you want it updateing the Y position? opr just say it ones
I need to teleport the player to his Y position, but when the player is teleported, as you can see, the Y value changes until it goes back to the correct Y for no apparent reason. It should normally be correct from the start
before tp : 3.002932548522949 (x33) - Client - LocalScript:8
After: it's change a lot until it's come back too : 2.999999761581421 (x45) - Client - LocalScript:8
** You are now Level 4! **
If you just want to tp the player to position I think there a better script to do that, not at my computer be on it tomorrow
How is it going to be triggered?
Proximity promt, when the player enable it i tp him in front of a part
With the position of part + 7.5 (offset) but keep the Player.Y to not cause bug but ye
Oh ok ya, I can help with that tomorrow
But hopefully you find someone sooner to help
Okay thank you @ me when you can
Bc as you can see, I’m already using the player’s current Y, but after teleporting, the client console shows the Y changing a lot before stabilizing. That’s the problem, because it’s visible in-game. A teleport should be smooth — if Y = 2.93, it should stay 2.93, not go 2.91 → 2.92 → 2.93.
was in no rush at the time didnt had the pc front of me lol
but i get it
been ther
what is this for in game? if you want tp
local targetPosition = Vector3.new(0, 10, 0) -- Change to your desired position
teleportPart.Touched:Connect(function(hit)
local character = hit.Parent
local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
humanoidRootPart.CFrame = CFrame.new(targetPosition)
end
end)
Sorry just come back i test it when im come back and tell you @safe steeple
No worries won’t be home rest of the day
So yeah, when you set Y to 3 it works fine and doesn’t move anymore, but that’s the problem — if my map is higher or there’s another situation, I need to use the player’s Y. But when I do that, it lags.
If it lags means it spamming you just got make give breaks
Task.wait(1)
Im sure it's not, when im on my pc gonna put some print to see
That if you want the to keep to to that position if not make sure it not in a loop
** You are now Level 5! **
I’m not on my PC right now, so I’ll just show you part of my code:
for Index, Microphone in pairs(Microphones) do
Microphone.Triggered:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
HumanoidRootPart.CFrame = CFrame.new(
Vector3.new(
Microphone.Parent.Parent.CFrame.Position.X + Microphone.Parent.Parent.CFrame.LookVector.X * 7.5,
HumanoidRootPart.Position.Y,
Microphone.Parent.Parent.CFrame.Position.Z + Microphone.Parent.Parent.CFrame.LookVector.Z * 7.5
),
Microphone.Parent.Parent.CFrame.Position
)
end)
end
It's not in a loop ?
Doesn’t look like it
It weird that it spams it
Oh you asking why it's spam in consol that why :
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local RunService = game:GetService("RunService")
while true do
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local pos = player.Character.HumanoidRootPart.Position.Y
print("Position du joueur:", pos)
wait(0.05)
end
end
But ye after the tp it's should be stable, so somethings wrong with the tp
Oh so what the problem with the I’m getting confused what the problem then?
I want the player to be teleported in front of the microphone while keeping their Y position. But when I do that, the Y changes a lot and the player can see this change, which shouldn’t happen. After teleporting a player, it should be instant you know what I mean?
Y = 3 so it's should stay 3 not 2.95 > 2.96 > 2.97 to 3
Sounds like you need save data of a position, I would not know oh yo do that atm
Here the probleme @safe steeple :
As you can see, the player moves slightly after the teleport — that’s the problem. They should be teleported there on the ground and not move afterwards.
I should just anchor the player ?
It doesn’t matter it depends on game play
here an idea, u could have a predterm spot where the players would be tp too when hold E then have them achour there and hold E to unachour