Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I Make This Explosion Go to The Player Mouse?

Asked by 3 years ago
Edited 3 years ago

I want to make this explosion go to the player's mouse but i don't know how.

My Script:

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local Explosion = game.ReplicatedStorage.Explosion:Clone()
Explosion.Parent = workspace
Explosion.CanCollide = false
Explosion.Anchored = true
Explosion.CFrame = --I don't know what to put here

1 answer

Log in to vote
0
Answered by
sngnn 274 Moderation Voter
3 years ago

You can get the mouse's 3D position, using Mouse.Hit:

Explosion.CFrame = mouse.Hit
Ad

Answer this question