Workaround for getting updated position of humanoidrootpart

I have projectiles that use the humanoidrootpart as its starting point.

https://gyazo.com/8548c32cccce77382cd336178c52c35d

In the video you can see when moving the projectile starts where the humanoidrootpart was a little bit before. This is because that’s where the server thinks the player is. An easy fix is sending the humanoidrootpart position through the remote event. But, what if I want to have the ability be delayed, for example, I want the player to play a windup animation, then the ability activate. But how would I get the updated humanoidrootpart position? I can’t delay the remote on the client because I need to call it instantly for the projectile to be welded to the player to look like the player is throwing the projectile. Help would be appreciated.

4 Likes

You would fire the remote event after the player lets go
Not accurate but here’s an example so you get the idea

UserInputService > InputBegan > If MouseButton1 then HeldDown = true

UserInputService > InputEnded > If HeldDown = truethen Remote:FireServer() HeldDown = false

Variable check prob wasn’t necessary but you get it

I’m not talking about holding down a button. I’m talking about how to accurately get the humanoid root part’s position when the server event of the remote event is delayed to sync with the animation played on the client. I have to fire the remote upon input entered because the animation requires a projectile that must be motor6d’ed to the player.

Still have not found a solution. Help really appreciated!

probably gonna end up needing a second remote, either an event handshake or an unsafe remote function

Is there really no other way to do this?

there is another way calculating it with Player:GetNetworkPing() and the humanoid’s current velocity, but i don’t believe its sufficiently accurate for this purpose

So the best way may be to use a server to client to server remote function?

the easiest solution would be a remote function that the server invokes from the client to just return the position, though this is considered unsafe as the client can yield forever and therefore making the server yield forever.

A remote event handshake (server fires, then client fires) is better recommended as a practice.

Though on another look i must add, the better solution still seems to me to delay-and-play the animation from the client, and to spawn the projectile from the server using only one remote event.

Since I’m guessing that what you’re trying to make is a superball classic gear, usually the ball is already parented to the player’s hand just from equipping the tool (and therefore can just toggle visibility)

Hmmm. I see a lot of games do this, but Idk if they do it this type of way. I did think of having a remote to create the animation part for the animation and then call the actualy ability. (Yes it is the classic superball gear)

There’s also the posibility of calculating where the HRP is based on the last position and the velocity of it

How would that be possible. Also when the player changes direction wouldn’t it not work?

Still need an optimal solution for this, I don’t want to try to rework because of security issues or something else