How to make this projectile grow only on one side [video + script]

  1. What do you want to achieve? Hello, I would like to find a way for the projectile to grow but only on one side, while remaining stuck to the weapon attachment. As you can see on the video, the problem is that the projectile grows on both sides while remaining at the same point. Do you know if there is a not too complicated way to do this from the following script? Thanks for reading, the video and the script are below

  2. What is the issue? Help System - YouTube

  3. What solutions have you tried so far?

		local pierre = rs.Vehicule.FuturisticBalle.BalleFuturistic:Clone()
		pierre.Parent = workspace.Route.Players[plr.UserId..''].Balles
		connexionBalle = Runs.RenderStepped:Connect(function()
			if workspace.Route.Players[plr.UserId..''].Armes:FindFirstChild('ArmeFuturisctic') then
				pierre.Depart.CFrame = workspace.Route.Players[plr.UserId..''].Armes.ArmeFuturisctic.BallePosition.WorldCFrame 
				pierre.Grossissement.Size = Vector3.new(pierre.Grossissement.Size.X +0.1, pierre.Grossissement.Size.Y, pierre.Grossissement.Size.Z)
			else
				if connexionBalle ~= nil then
					connexionBalle:Disconnect()
					connexionBalle = nil
				end
			end
		end)

You have to reposition it while it is growing in size

You can use the part’s size to fix this issue. It just requires some extra CFrames when you are setting the CFrame of the part.

Assuming your part is Roblox’s cylinder (from the video) you can do:

pierre.Grossissement.Size = Vector3.new(pierre.Grossissement.Size.X +0.1, pierre.Grossissement.Size.Y, pierre.Grossissement.Size.Z)
pierre.Depart.CFrame = workspace.Route.Players[plr.UserId..''].Armes.ArmeFuturisctic.BallePosition.WorldCFrame * CFrame.new(0, 0, -pierre.Grossissement.Size.X / 2) * CFrame.Angles(0, math.rad(-90), 0)

This should work for you and it does work on my end but If you have any problems, let me know!

1 Like

Thank you very much for your answer the principle works except that the cylinder goes to the left instead of going straight, I try to find a solution but for the moment nothing

Here is the final working script :

pierre.Grossissement.Size = Vector3.new(pierre.Grossissement.Size.X +0.1, pierre.Grossissement.Size.Y, pierre.Grossissement.Size.Z)
pierre.Depart.CFrame = workspace.Route.Players[plr.UserId..''].Armes.ArmeFuturisctic.BallePosition.WorldCFrame * CFrame.new(-pierre.Grossissement.Size.X / 2, 0, 0)

Thanks for your help!

1 Like

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