Currently, I am trying to detect when a player lands so I can place a part in the position he lands in, I am doing this with a raycast under Stepped. However, the current method I am using is less responsive than using .Touched, but I don’t want to use touched because I want the position he landed in. Any solutions?
I suggest using Humanoid:StateChanged for this.
If new == Enum.HumanoidStateType.Landed then raycast downwards to find their position.
Tried it, same problem with touched, the position isn’t where I wanted it to be
Where is the position currently vs where you want it to be? You don’t have to use a raycast either. Their landed position can literally just be the players height subtract a relative offset if you want the ground position.
Also. Did you set the parameters of the raycast to ignore the player?
I’m not talking about it being wrong, as you know physics between server and client has a slight delay, with the rayCast I can have the position where the player landed because I can constantly check where he landed.
The client has full control of their own characters physics, so that’s not the case. Can you be more concise with what’s happening vs what you want to happen?
It’s just a matter of responsiveness, say I record the player’s position when he lands with StateChanged. The player’s position vs recorded position isn’t going to be the same due to velocity affecting the player.
Are you listening to StateChanged on the server currently? If so, you should be listening to it on the client via localscript, as soon as they land you can raycast down to find their position. There shouldn’t be any delay.
I’m trying to make this secure as it will affect other clients. For what I am trying to do with this.
Use a remoteevent to send it to the server and add security checks.
an exploited client can already fully control their character and have it replicated to the server, if they wanted to, they could already control whether or not they ever land even if the check is done on the server, it’s generally not worth the hassle and delay doing it like this. what you can do is have every client detect everyone else’s landing by having a localscript that goes through every character and checks when it lands and do things accordingly, this way you make sure everything matches up with what everyone else is seeing, if you want to let the server know a player landed, a simple remoteevent would works just as fine due to the aforementioned control clients have over their character