How does AlignPosition work?

I made a system whereas a character follows a player with BodyPosition. But BodyPosition makes the character have a slight delay to its goal instead of being there constantly. I used Welds but the weight balance between the player’s character and the character is terrible. I was thinking of using AlignPosition due to its RigidityEnabled property. I added two attachements to the HRPs of the player character and character. But i dont know how to change the positions nor how to use AlignPosition.

So how does 1 and 2 attachement modes work?

How do i change position of the character?

Im asking this because the documentation of AlignPosition is poor. It only explains 45% of AlignPosition.

Video

As you have seen in this video, The character is meant to go at a certain position… rather than being there quicker… it takes a longer time that expected to get their, Especially when you walk backwards.

That’s why i need to use AlignPosition. I tried using it asif it was BodyPosition, But the stand ends up in 1 position.

Hey,

Have you tried looking for other posts with this same title?
This might be in your best interest to check out.

I did, But they dont truly answer my question. The answer in the post you linked to is hell bent on AlignORientation not AlignPosition.

I see. I think I know what value you’re looking for with AlignPosition, try enabling the ReactionForceEnabled boolean value(?)

Im going to add in a video of me using BodyPosition and what i meant.

I see your problem now, I apologize.

The problem stems from the fact that we have to take into account server-ping delay. The character following you takes into account the received position your character is currently at on the server. To fix this, just take advantage of Network Ownership.

1 Like

Ok, That makes sense. Now then, I guess i am supposed to set The Owner to the Player?

Should i do it in a LocalScript or a ServerScript?

Network Ownership is only accessible via the server. Read the official documentation for more information.

Ok Tysm. I hate that little delay… So the player character should be the networkOwner? or The server should always be the networkOwner.

You can only assign a player to the NetworkOwner. Please check the official documentation for more questions, it’s all there :grinning_face_with_smiling_eyes:.

I did check the documention. It says that you can always make the server the networkOwner by doing

Part:SetNetworkOwner(nil).

But i guess the player should be the networkOwner

Hey there,

Sorry for the late response.

nil represents the player instance that’d be taken in.

Ok! Thank you. Now i will manipulate the networkOwnerShip.