generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Ball spawns ontop of a NPC instead of the NPC's torso

Previous Thread :: Next Thread 
PurpleTerror is not online. PurpleTerror
Joined: 05 Oct 2010
Total Posts: 7368
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
samiam2001 is not online. samiam2001
Joined: 15 Jun 2010
Total Posts: 34431
18 Apr 2015 07:19 PM
use cframe
Report Abuse
NotAshley is not online. 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
PurpleTerror is not online. PurpleTerror
Joined: 05 Oct 2010
Total Posts: 7368
18 Apr 2015 07:37 PM
@samian and NotAshley

thx for saving a bloxian life
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image