How do I Rotate the model with CFrames while Changing its position also?
Asked by
2 years ago Edited 2 years ago
Here is my current code
01 | local function summonWave(player, playerPos) |
02 | local clonedAbility = ability:Clone() |
03 | clonedAbility.Parent = workspace |
04 | local rootPart = clonedAbility.PrimaryPart |
05 | clonedAbility:SetPrimaryPartCFrame(CFrame.new(player.Character.PrimaryPart.Position + player.Character.PrimaryPart.CFrame * CFrame.Angles( 0 , 0 ,- 90 ))) |
07 | clonedAbility:SetPrimaryPartCFrame(CFrame.new(player.Character.HumanoidRootPart.Position.X, player.Character.HumanoidRootPart.Position.Y,player.Character.PrimaryPart+ player.Character.HumanoidRootPart.CFrame.LookVector)) |
11 | 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