[SOLVED] Why do the parts I clone always go on top of everything else when they appear?
Asked by
6 years ago Edited 6 years ago
If you've ever seen My Hero Academia, an anime show, I'm trying to make a Todoroki Ice Slide move, I'm not entirely done with it yet, but everything but one thing that I've done so far works. This script makes clones of a part inside of the script, and puts them behind the player to look like the player is using ice to push him/herself forward. It creates the parts, but every part it clones, automatically gets put on top of everything else and it makes it look weird.
01 | UIS.InputBegan:connect( function (key) |
02 | if key.KeyCode = = iceSlideKey and enabled = = true then |
04 | while keyDown = = true do |
05 | char.Humanoid.Jump = true |
06 | char.HumanoidRootPart.Velocity = char.HumanoidRootPart.CFrame.lookVector* 100 |
07 | local slide = iceSlide:Clone() |
08 | slide.Position = char.HumanoidRootPart.Position - char.HumanoidRootPart.CFrame.lookVector* 10 - Vector 3. new( 0 , 10 , 0 ) |
09 | slide.Parent = game.Workspace |
11 | slide.Orientation = char.HumanoidRootPart.Orientation + Vector 3. new( 0 , 180 , 0 ) |
12 | slide.CanCollide = false |
18 | UIS.InputEnded:connect( function (key) |
19 | if key.KeyCode = = iceSlideKey and keyDown = = true then |
By the way, this isn't the full script, so if you test it, it won't work. Here's a gif of what it does. https://gyazo.com/a7bc1d36316ab3e7009a7421e02163ea