Throwing relativity problem

You can write your topic however you want, but you need to answer these questions:

  1. I Want to make the Noob to throw balls in a width line.

  2. The throw relativity is dependent on the world, I Want it to be on the Noob Primary part.

This when throwing at the back direction of the world:
image

And this is when I try to throw at the right direction of the world:
image

local t = 0.4
	local PrimaryPart = Noob.PrimaryPart
	local g = Vector3.new(0, -game.Workspace.Gravity, 0)
	local x0 = PrimaryPart.CFrame * Vector3.new(0, 2, -2)

local Turn = false
		for i = 1, 5 do
			if Turn == false then
				Turn = true
			else
				Turn = false
			end
			local AcidBall = game.ServerStorage["None playable tools."]["Acid stone."]:Clone()
			AcidBall:SetAttribute("Holder", Player.Name)
			AcidBall:SetAttribute("Damage", Noob:GetAttribute("Damage"))
			AcidBall.Parent = workspace
			if Turn == true then
				AcidBall.Position = Noob.PrimaryPart.Position + Vector3.new(-i * 2, 0, 0)
			else
				AcidBall.Position = Noob.PrimaryPart.Position + Vector3.new(i * 2, 0, 0)
			end
			local v0 = ((Target - x0) + Vector3.new(0, 3, -4) - 0.5 * g * t * t) / t
			AcidBall.AssemblyLinearVelocity = v0
		end

.

2 Likes

try this instead
image

Wait so what exactly are your trying to do, can you explain with more detail

Use CFrame:ToObjectSpace() to get the relative position of a Vector3 from a CFrame.

We will also use PVInstance:PivotTo() to position the ball by the CFrame it returned.

if Turn == true then
	AcidBall:PivotTo(Noob.PrimaryPart.CFrame:ToObjectSpace(Vector3.new(-i * 2, 0, 0))
else
	AcidBall:PivotTo(Noob.PrimaryPart.CFrame:ToObjectSpace(Vector3.new(i * 2, 0, 0))
end

I Am making a bot throw five balls of acid.

I Am thankful for the help, But, ToObjectSpace Argument needs a CFrame not a vector.

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