|
| 18 Apr 2015 07:17 PM |
This function is part of my new boss fighting game. This is a fake explosion that spawns and grows at the position of the NPC's torso. But when the function executes it spawns and grows ontop of the NPC.
function fireball() local c = Instance.new("Part",workspace) c.Name = "Charge" c.TopSurface = "Smooth" c.BottomSurface = "Smooth" c.BrickColor = BrickColor.new("Bright red") c.Size = Vector3.new(1,1,1) c.Anchored = true c.CanCollide = false c.Shape = "Ball" for i = 1, 100 do c.Size = c.Size + Vector3.new(1,0,1) c.Position = script.Parent.Torso.Position c.Transparency = c.Transparency + 0.01 wait(.01) end c:remove() end
|
|
|
| Report Abuse |
|
|
| |
|
NotAshley
|
  |
| Joined: 16 Jan 2014 |
| Total Posts: 14257 |
|
|
| 18 Apr 2015 07:31 PM |
Vector3 has built-in hit detection that won't allow it to be place inside an object.
Try this:
c.Size = c.Size + Vector3.new(1,0,1) c.CFrame = CFrame.new(script.Parent.Torso.Position) |
|
|
| Report Abuse |
|
|
|
| 18 Apr 2015 07:37 PM |
@samian and NotAshley
thx for saving a bloxian life |
|
|
| Report Abuse |
|
|