Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a part tilt forward?

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?

7 comments

0

like over and over?

0

no, only once, as I want to CFrame it that way when I run the code

0

why only once?

0

because I want it to stay in that one position.

0

Then, why not put it in that position to start with?

0

that's what im trying to do...

0

Well I posted an answer, if it doesn't work tell me.

1 answer

✓ Accepted answer
--// 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.

6 comments

0

Thanks, but it continuously points in one direction, not according to my head. How does that part work? xD

0

I'm not quite sure, I'm sorry...

0

o

0

Thanks anyways, though, I'll try to build off of this

0

fixed it myself xD

0

k

This discussion is preserved as it was. New answers, comments, and votes are closed.