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

How do I make a part tilt forward?

Asked by
Astilev 30
8 years ago

I have this so far

part = Instance.new('Part',workspace)
part.FormFactor = 'Custom'
part.Size = Vector3.new(5,4,0.1)
part.Anchored = true
part.CFrame = game.workspace.DullBakuganroll.Head.CFrame*CFrame.new(0,0,-5)*CFrame.Angles(0,math.pi*1/4,0)

I'm aware that this makes it turn 45 degrees, but how do I make it tilt the same amount, but forwards?

0
like over and over? yoshi8080 445 — 8y
0
no, only once, as I want to CFrame it that way when I run the code Astilev 30 — 8y
0
why only once? yoshi8080 445 — 8y
0
because I want it to stay in that one position. Astilev 30 — 8y
View all comments (3 more)
0
Then, why not put it in that position to start with? TheHospitalDev 1134 — 8y
0
that's what im trying to do... Astilev 30 — 8y
0
Well I posted an answer, if it doesn't work tell me. yoshi8080 445 — 8y

1 answer

Log in to vote
3
Answered by
yoshi8080 445 Moderation Voter
8 years ago
--// Gets player
local person = game.workspace:FindFirstChild("DullBakuganroll") or game.workspace:WaitForChild("DullBakuganroll") -- Change to the playername
--// Inserts a new part into player
part = Instance.new('Part',person)
--// Edits part's properties
part.FormFactor = 'Custom'
part.Size = Vector3.new(5,4,0.1)
part.Anchored = true
part.Rotation = Vector3.new(0,0,45) -- change any value to however you want
--// Makes part follow player
while wait() do 
part.Position = person.Head.CFrame * Vector3.new(0,10,0) -- change to see how far you want it above your head
end

There is somethings I changed. I made it simple by using the part's rotation and made it follow you, so it won't stay in place

I made sure it would always go and use FindFirstChild("DullBakuganroll") and WaitForChild("DullBakuganroll") so no errors would occur than using game.workspace.DullBakuganroll I put the part into the player so you can tell where it is.

0
Thanks, but it continuously points in one direction, not according to my head. How does that part work? xD Astilev 30 — 8y
0
I'm not quite sure, I'm sorry... yoshi8080 445 — 8y
0
o Astilev 30 — 8y
0
Thanks anyways, though, I'll try to build off of this Astilev 30 — 8y
View all comments (2 more)
0
fixed it myself xD Astilev 30 — 8y
0
k yoshi8080 445 — 8y
Ad

Answer this question