Can Client-sided parts be moved with BodyPosition?

I have a part that’s created from a LocalScript, so it only exists for the local player. From the local script I can reference the part in the workspace and change it’s Position, Color, etc.
But when I use a BodyPosition, it does not move the part at all. Everything worked if I make it all Server-sided, so nothing is wrong with the script or the BodyPosition’s properties.

So my question: is it even possible to do physics-related stuff like BodyMovers from the client?
I find it really odd that I don’t get an error and that the Position property of the BodyPosition does change. :anguished:

a few notes:
I am using StreamingEnabled, this means I have to make the parts only exist on the client so that they will never stream out.
Also, in similar posts on the DevForum the problem often was Network Ownership. But since in my case the part only exists on the client, that can’t be the problem.

If anyone could clarify this for me, that would be greatly appreciated :slight_smile:

1 Like

That’s weird, it’s working just fine for me. Did you make sure it’s unanchored? Screen Shot 2021-10-10 at 11.10.19 AM

2 Likes

Yes, it’s unanchored and not welded to any anchored parts.
In that example you have, are you also using BodyPosition and is StreamingEnabled enabled?

1 Like

Yes, each one is using a BodyPosition. They each use this:

Vector3.new(math.random(-10,10),math.random(0,100),math.random(-10,10))

to determine where it goes.

I forgot to turn on Streaming, let me quickly try that.

3 Likes

Hmm, still works for me with StreamingEnabled and BodyPositions. Can I see the script you’re using to create the parts/BodyPositions?

Okay that’s weird, but at least I’m reassured now that it is possible to use BodyMovers locally, so something is probably wrong in my game then, now just need to find out what it is haha.

I am actually not really “creating” them through a script. They already exist in the Workspace, and when the game starts a serverscript moves them to ReplicatedStorage. Then through a local script the parts get moved back into the Workspace, but now locally. I figured that’d work but maybe that is what’s causing the problem for the BodyPosition?

Yep, that’s the problem. I just tested it. It works if they start in ReplicatedStorage, but when they’re moved from workspace → ReplicatedStorage, it no longer works.
Screen Shot 2021-10-10 at 11.35.29 AM
Do you have to have the parts start out in workspace, or is it possible for them to start out in ReplicatedStorage?

2 Likes

They don’t absolutely need to be in the Workspace, but when I’m building that makes it a lot easier. So I’ll try to find a way to work around that.

But thank you so much! I spent so long on trying to figure out what was wrong but apparently I was looking at the wrong things haha.

Happy to help!
I actually just found a workaround, if you don’t want to keep them in ReplicatedStorage. If you :Clone() whatever you want to run physics on, then put that clone in workspace, it works as normal.

1 Like

It works, and such an easy fix haha, thanks! :slight_smile: