Need a guide to make vfx on projectile

Hello, Im beginner scripter and somehow I see a lot of game in Roblox that when they shoot skill, magic or some projectile there are effect while projectile is launch. something like picture below if u can’t imagine.

as you can see the blue oval represent effect.
Thank for guide me. :grin:

1 Like

Hey, here is what I would recommend doing:

(Click on the steps to view more info)

2 Likes

Expanding off of what @TheBrainy06 said, Roblox actually has a pretty good tutorials with their Onboarding program. The two tutorials you may need are as listed below:

The first one is just if you need to know how to use the tool object. The second one includes all the steps that @TheBrainy06 mentioned and provides a step-step explanation of what it’s doing and why.

Once you get that down, if you don’t want to use the tools you can detect detect user input from a local script using either UserInputService | Roblox Creator Documentation or ContextActionService | Roblox Creator Documentation, although ContextActionService is recommended because UserInputService is less direct and more nuanced. If you need a tutorial for this then Roblox also has for Detecting User Input | Roblox Creator Documentation.

Note: the tutorial “Detecting Player Input” uses ContextActionService with a tool, but you do not need to have a tool to use it if you don’t want to. All it really does is bind one or more keys to a specific function when pressed or unpressed.

what about damage? what is the best way to detect if it hit raycasting, touched event or region3

Raycasting is the best method. With raycasting all you have to do is something like this:

local projectile = workspace.Projectile -- example part

local distance = 3
local frame = projectile.CFrame

local result = workspace:Raycast(frame.Position, frame.LookVector * distance)

if result then
	-- do code for whatever you want to do on a collision.
else
	projectile.CFrame += frame.LookVector*distance -- move the projectile forward
end

One thing I should mention, usually creating and destroying instances as fast as some games do means it will create some lag. To avoid this games usually implement a part-cacheing system so that they can reuse old projectile parts. One of the best modules out there for this (that I know of) is PartCache.


The best method for projectiles is to anchor them and then CFrame them along a path.

Also, Workspace | Roblox Creator Documentation and the other region3 functions have been deprecated and replaced with WorldRoot | Roblox Creator Documentation and WorldRoot | Roblox Creator Documentation.