AlignPos Being Inconsistent

I made a pickup system where you pickup and hold objects in front of you using AlignPos and AlignOri. However, it seems very inconsistent.
I have a remote event firing off to the server whenever the player is holding an object to tell the server where the attachment needs to be for the carried object to be moved to. However, the align position seems to only work when the player is standing still half the time, and perfectly the other half.

I have a fake object that is shown only to the client for carrying objects to be smoother for them, and a mostly transparent object that is the server sided object while carrying.

This video shows this happening, with the first half being super inconsistent and the second half behaving perfectly as intended. Despite me dropping the object halfway through and it becoming better then, that behavior happens consistently in the middle of carrying an object.

I tried messing with network ownership and CFrame, but that made the behavior worse as the objects are intended to be thrown around as shown in the video. Is there something with Network Ownership I’m missing?
I learned that slowing down the time between updating the CFrame of the attachment in front of the camera causes the strange behavior to go away, however objects can no longer be thrown and it looks extremely choppy at speeds of greater than .1 seconds, which is the rate it works at.
I just want to get rid of this weird behavior and for the movement in front of the object to always be consistent, not just half the time. Any ideas?

This is very strange. Could you share your script(s) so we can look closer at them?

If not, I would suggest making sure the event is firing correctly, and going through / commenting your current code line by line to make sure you aren’t missing anything.

1 Like

The event is firing accordingly, I checked on the server to see what the server thought the attachment point was and it seemed to be updated consistently even during the moments of choppiness. Here’s the order of code in chronological order:

Here is creating the AlignPos and AlignOri once the player picks up the object for the server sided object so it knows where to go, along with anything else that makes a better gameplay experience.

The code for the client sided object.
image

When an object is held, fire to the server that an object is being held, CameraAttachment is a part with an attachment inside:
image

Update the CFrame of the attachment
image

This is when the player drops the object, it fires the server and removes the client sided object along with restoring the server sided object to be visible again:
image

This is the last piece of code that drops the object on the server, it returns the object to its usual collision, restores the player to be able to interact with objects again, and removes the AlignPos and AlignOri so that the object is just unanchored.

I’ve been through the code a number of times and I just don’t know what could be causing it. I’m going to try testing it in the actual game instead of studio to see if that could be the issue.

So, I looked through the code, and I believe the only things that could be causing issues are the events firing here.

Perhaps you could try doing print() functions in these two things to make sure they work right? Also, I can’t tell because of the point where the code cuts off, but make sure that the loop (if there is one) that the client sided bit is in fires enough to actually make the code work.

Let me know if you’ve already tried this and I’ll stare at your code for another fifteen minutes.