How do I make this part move?
01 | local UIS = game:GetService( 'UserInputService' ) |
02 |
03 | subinput = UIS.InputBegan:connect( function (input,gameProcessedEvent) |
04 |
05 | if gameProcessedEvent then return end |
06 |
07 | if input.KeyCode = = Enum.KeyCode.Space then |
08 |
09 | local part = Instance.new( "Part" ) |
10 |
11 | part.Position = game.Workspace.world_kiIIer.RightFoot.Position |
12 |
13 | part.Transparency = 1 |
14 |
15 | part.Size = Vector 3. new( 4 , 1 , 4 ) |
16 |
17 | part.CanCollide = true |
18 | |
19 | wait( 2 ) |
20 |
21 | part:Destroy() |
22 |
23 | end |
24 |
25 | end ) |
To move a part you want to CFrame it. CFrame’s can be used to change the position and orientation of a part.
For more information about CFrames click this Roblox Wiki link:
https://developer.roblox.com/api-reference/property/BasePart/CFrame