You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I am trying to make a flash with two different colored bricks that rotate randomly when the gun is shot -
What is the issue? Include screenshots / videos if possible!
When altering the CFrame of the two parts that are supposed to rotate, the gun seems to make me randomly rotate with the parts, instead of the two parts rotating on their own. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve checked to see if the parts were cancollided, I redid weld constraints, and I’ve looked at other gun tutorials including EgoMoose’s tutorial, but none of them seem to get to the point I am needing help with
I will attach a video of what is happening when I shoot.robloxapp-20200618-0724283.wmv (1.2 MB)
Here is the code I am using to rotate the cframe of the two parts:
local function fire()
--//Checks
if canShoot:InvokeServer() then
--//Initialize
if recoilTrack then
recoilTrack:Play()
end
--flashGui.Enabled = true
local rand = math.random(0,360)
red.Transparency = 0.3
orange.Transparency = 0.3
red.CFrame= CFrame.Angles(math.rad(rand),math.rad(rand),math.rad(rand))
orange.CFrame =CFrame.Angles(math.rad(rand),math.rad(rand),math.rad(rand))