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

How do I Rotate the model with CFrames while Changing its position also?

Asked by 1 year ago
Edited 1 year ago

Here is my current code


local function summonWave(player, playerPos) local clonedAbility = ability:Clone() clonedAbility.Parent= workspace local rootPart = clonedAbility.PrimaryPart clonedAbility:SetPrimaryPartCFrame(CFrame.new(player.Character.PrimaryPart.Position + player.Character.PrimaryPart.CFrame * CFrame.Angles(0,0,-90))) clonedAbility:SetPrimaryPartCFrame(CFrame.new(player.Character.HumanoidRootPart.Position.X, player.Character.HumanoidRootPart.Position.Y,player.Character.PrimaryPart+ player.Character.HumanoidRootPart.CFrame.LookVector)) end abilityEvent.OnServerInvoke = summonWave

I know this is a bit hard to read as I didn't make much variables . I get the wall to spawn where the player is at but I'm not sure how to rotate it

Note: I'm trying to rotate the Z Coordinate

0
* CFrame.Angles(0,0,math.rad(-90)) first issue, second issue, multiply all CFrames (convenient to remember), third multiply lookvector with number since it is a unit vector / normal vector. greatneil80 2647 — 1y

Answer this question