AssemblyLinearVelocity not working when scripted - fixed

lmao I found it out, I feel like such a silly goose. The object it spawns on collides with the orbs. I have now fixed it lol

Hey! I am making a simulator, and I am trying to make a orb/drop system like Pet Sim X/99.
One problem I have encountered is when setting AssemblyLinearVelocity in a script.
The image below shows the part, or the origin the drop is spawned in. The assembly linear velocity is set to random numbers for x and y, however no matter what, the orbs start to move to the left and never the right. Even if the X value for the AssemblyLinearVelocity is positive, as seen in these two photos below.

image
image

The photo below shows the output of the force (aka, what the random force is set to.)
As you can see, it sometimes is a positive number, but it never goes to the right, and always goes to the left.
image

My code is below, maybe it has to do something with my code?
Whenever I did it in studio, and set the AssemblyLinearVelocity’s X to a positive number, it WOULD go to the right, but not whenever I set it to that in a script.

local orbs = {}

for i = 1, amount do
	local clonedOrb = selectedOrb:Clone() -- clones it
	clonedOrb.Anchored = false -- makes the anchored false, so it can do the same thing as psx
	local randomAmount = math.random(minAmount, maxAmount) -- again, this is for the line below.
	clonedOrb:FindFirstChild("Gives").Value = randomAmount -- dont mind this, it really isnt important.
	clonedOrb.Parent = workspace.Orbs -- sets the parent to the Orbs folder in workspace
	clonedOrb.Position = Origin.Position -- sets the clonedOrb's pos to the origin/original part

	local randomx = math.random(-30000, 30000)
	local randomz = math.random(-30000, 30000) -- these two lines set the randomx/z to a random number

	local force = Vector3.new(randomx / 1000, 90, randomz / 1000) -- allows it to have decimals, so it is usually never the same number.

	clonedOrb.AssemblyLinearVelocity = force -- sets the force
	print(clonedOrb.AssemblyLinearVelocity)

	table.insert(orbs, clonedOrb)
end

I would actually appreciate it so much

1 Like