I’m making a pistol for a game, I’ve never tried something like that so I didn’t know which was the best way to make the bullets, I thought making a projectile using BodyVelocity but I ended up using TweenService.
I made sure that the bullet faces towards the players mouse, but when Tweening the bullets position to it, it also rotates, like this:
I’ve tried alot of weird stuff, my closest attempt was tweening the cframe using “CFrame.lookAt” but it still did not work. I’ve also tried to tween the Position instead of the CFrame but it also didn’t work for some reason
I dunno if it’s necessary but heres the tweening code:
You can, You just Multiply the Position and Rotation like so:
Position = CFrame.new(0, 1, 0)
Rotation = CFrame.Angles(0,0,0)
-- CFrame.Angles uses Radians to Apply a Rotation
-- 180 degrees in radians is math.pi
-- 360 is math.pi*2
-- 90 is math.pi/2
-- Multiply them like so
Goal = {CFrame = Position * Rotation} -- Should work
Just obtain the initial rotation of the bullet and supply that to the tween parameters, currently with no rotation supplied it ends up tweening to (0,0,0):
I have found the solution myself, I wanna say thanks to everyone who helped me but yeah…
My solution is probably not ideal, but It’s what made it work after all.
All I did was make an invisible part on the Mouse’s Position, make it look at the gun’s handle, rotate it 180 degrees and tween the bullet to It’s CFrame