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

How do I use CFrame to rotate the mesh?

Asked by 6 years ago
Edited 6 years ago

The script functions the link leads to a gif containing the problem. https://s2.gifyu.com/images/Kapture-2019-02-26-at-16.39.00.gif

NOTE: The projectile did not fire in the wrong direction, I simply slowed the projectile's speed so you could see the projectile mid air. The Mesh attached to the model is backwards. I cannot rotate it even though I used the CFrame.Angles function. While using the CFrame, the projectile fires in the correct direction, but the mesh remains facing facing the wrong direction. How do I use CFrame to rotate?

01        local rocketClone = Rocket:Clone()
02        --game.Debris:AddItem(rocketClone, 30)
03        rocketClone.BrickColor = player.TeamColor
04        rocketClone.Touched:connect(function(hit)
05            if hit and hit.Parent and hit.Parent ~= player.Character and hit.Parent ~= tool then
06                rocketClone:Destroy()
07            end
08        end)
09 
10        spawn(function()
11            wait(30)
12            if rocketClone then rocketClone:Destroy() end
13        end)       
14 
15        -- Position the rocket clone and launch!
View all 33 lines...
0
I have tried that... Maybe I haven't done it correctly. How would I go about using Orientation ExHydraboy 30 — 6y
0
orientation bad, vector3 is not meant for rotating. However @OP you clearly are giving an XY problem so your goal is not clear. User#24403 69 — 6y
0
WDYM ExHydraboy 30 — 6y
0
Flip the rocket around and have it go in the opposite direction. crywink 419 — 6y
View all comments (2 more)
0
It's funny that you mentioned that because I tried that but then I am unable to get the rocket to fly towards my look vector. ExHydraboy 30 — 6y
0
How would you do that ExHydraboy 30 — 6y

Answer this question