Weird in-game AlignPosition issue (Big objects getting pushed by smaller objects)

https://gyazo.com/a053b9e8dcd94835bcbafff5c7658bc8
https://gyazo.com/a4d077443d13b464e066c5583888f4cc
https://gyazo.com/57aec7dd67524f482733069cd167c78f

I’m working on this project with AlignPositions. In 2 of the videos, it showcases the issue I see when I’m playing in-game - a small spaceship can push a large spaceship with some amount of weird glitching. In the other one it shows what happens every single time if I pause the game, copy the assets, and paste them into another studio with all the same velocity, Align goal, etc. I can hit play in-game and see the glitching happen, and hit play in the new studio and it will run perfectly.

Has anyone experienced anything similar? I’ve done SetNetworkOwner(nil), checked all the MaxForce / MaxVelocity and I’m setting the AlignPosition.Position every frame, but I can see it being set to the same thing, and I wouldn’t expect that to change anything.

Similarly I tested to see if there was any rogue cframing happening that might be causing the smaller ship to be cframed continuously even though it shouldn’t be. I get no warnings when I do this, but if I intentionally set the cframe, I can see the warning.

model.PrimaryPart:GetPropertyChangedSignal("CFrame"):Connect(function()
	warn("A cframe has been set that shouldn't be: ", model.PrimaryPart:GetFullName())
end)

And lastly, if I use the new PhysicsStepping in studio, what I see happen is in a step the two objects overlap, the small ship gets pushed back, then they just sort of stay in the same position until randomly 20 frames later the big ship gets pushed back

Any help / thoughts would be appreciated.

^ I just tried another similar test, where it would tell me if any changes happened to the AlignPosition.Position value where it changed by a distance > 1 stud, I can watch the issue actively happen for ~15-30 seconds without this printing a single thing, but it prints when I purposely change the value.

	local LastPosition = AlignPosition.Position
	AlignPosition:GetPropertyChangedSignal("Position"):Connect(function()
		local NewPosition = AlignPosition.Position
		local Distance = (NewPosition - LastPosition).Magnitude
		
		if Distance > 1 then
			warn("Large position change!!!")
			warn("Distance: ", Distance)
			warn("Last: ", LastPosition)
			warn("New: ", NewPosition)
		end
		
		LastPosition = NewPosition
	end)

Also just tested out changing my run thread from Heartbeat to a once-per-second thread and it still happens in-between runs.

I know the new workspace.MoverConstraintRootBehavior isn’t supposed to affect it, but I checked it anyways, and I still have the issue with both Disabled and Enabled.

After some further testing, it appears that the first time the objects collide in-game, it works perfectly every single time. The second time the same two objects collide it does the weird glitching thing every single time. I also don’t use .Touched at all in my code, so I’m not changing anything between the two collisions. So maybe it only works in the other studio because the two objects haven’t collided twice? --Edit - This doesn’t appear to be the case if I only use the move tool in studio.

Solved - The turrets are in a different model, that has attachments and a HingeConstraint to the core model. It appears that I also needed to do SetNetworkOwner(nil) on the turrets even though I assumed they would be part of the assembly and have the same network owner.

Edit: I haven’t confirmed this, but I did SetNetworkOwner(nil) on the main model before I added the turrets to the game / connected them to the ship. So it’s possible that adding the turrets changed the NetworkOwner of the core ship model somehow? Either way though, they just use a HingeConstraint, so I’m not entirely sure how this ended up affecting the positioning of the base ship.

Edit 2: I confirmed that the Ship SetNetworkOwner was being set before any of the turrets spawned in.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.