Math.random() isn't random?

You can write your topic however you want, but you need to answer these questions:
I want to make the sharks fly in random directions (sharknado :fearful:)

All of the sharks are going to the same general area

I’ve tried looking at the devforums to see how to make math.random() more random

local function createShark()
	local sharkClone = shark:Clone()
	sharkClone.Parent = game.Workspace.Game.Sharks
	sharkClone:SetPrimaryPartCFrame(CFrame.new(script.Parent.CFrame.Position))
	local force = Instance.new("BodyForce", sharkClone.PrimaryPart)
	force.Force = Vector3.new(math.random(50000, 95000), 0, math.random(25000, 95000))
end

JUST A REMINDER! I have also tried making the sharks orientation random, but that didn’t change anything

try changing the 50000 and 25000 to negatives so they fly the opposite direction, you’ve just created sort of a cannon of sharks with differing power.

Ok. Ill try that, that seems like a good idea

It worked! thank you very much

1 Like

Glad to see it! Make sure you mark my thread as a solution so you don’t get anymore replies!

It’s pseudo-random but for all intents and purposes it provides good randomness.

Oh yes, I forgot about that lol

1 Like