Nymra Posted October 9, 2021 Posted October 9, 2021 soooo, I basically have an X Marker that is used as a vehicle to set the PC in place. at times I have to detach the vehicle and I want to make sure, that the PC is back on the X marker before setting the vehicle again. So I use: "PlayerRef.MoveTo(vehicle)" in this case the PC will be teleported in the air above the x marker and then fall down. So if I set "PlayerRef.SetVehicle(vehicle)" directly afterwards, the PC will be floating in the air... so two questions: can I somehow move the PC to the spot ON the ground? like adding angles to the MoveTo? and which ones would I need? I dont understand where MoveTo moves to... meaning at which height. OR can I somehow check/bool if the PC is in the air and then just wait for it to be NOT in the air anymore "PlayerRef.MoveTo(vehicle)" while PCisIntheAir() wait(0.1) endwhile "PlayerRef.SetVehicle(vehicle)" thx alot again
Scrab Posted October 9, 2021 Posted October 9, 2021 PlayerRef.MoveTo(vehicle) Utility.Wait(2) ; Howeverlong it takes for the player to fall PlayerRef.SetVehicle(vehicle)
Nymra Posted October 9, 2021 Author Posted October 9, 2021 1 minute ago, Scrab said: PlayerRef.MoveTo(vehicle) Utility.Wait(2) ; Howeverlong it takes for the player to fall PlayerRef.SetVehicle(vehicle) hehe, well, that is exactly the way it is setup right now even with the 2 seconds wait I just wondered if there is a quicker and more precise way to do it.
Scrab Posted October 9, 2021 Posted October 9, 2021 5 minutes ago, Nymra said: I just wondered if there is a quicker and more precise way to do it. You could try PlayerRef.MoveTo(vehicle) float cZ = 0.0 While(cZ != PlayerRef.Z) cZ = PlayerRef.Z utility.Wait(0.1) EndWhile PlayerRef.SetVehicle(vehicle)
Nymra Posted October 9, 2021 Author Posted October 9, 2021 2 minutes ago, Scrab said: You could try PlayerRef.MoveTo(vehicle) float cZ = 0.0 While(cZ != PlayerRef.Z) cZ = PlayerRef.Z utility.Wait(0.1) EndWhile PlayerRef.SetVehicle(vehicle) uuh, neat will try that, thank you!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.