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
 

New part CFraming?

Previous Thread :: Next Thread 
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
23 Jul 2015 02:50 PM
I've made a bomb that creates a sphere which expands over like 8 seconds, however this sphere appears far above the bomb itself, and refuses to collide with any blocks.

The block expands with a loop by adding to a Vector3. What do I need to be doing?
Report Abuse
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
24 Jul 2015 04:34 AM
Bump and here's a diagram to explain what I mean. The "No" is what's happening right now, the "Yes" is what needs to be happening.

http://prntscr.com/7we4i6
Report Abuse
Fabunil is not online. Fabunil
Joined: 25 Oct 2013
Total Posts: 4325
24 Jul 2015 05:43 AM
You probably just added the Vector3 directly to the blocks Position.
Use CFrame instead:

block.CFrame = block.CFrame + yourVector
Report Abuse
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
24 Jul 2015 12:37 PM
Nope, tried that, nothing.
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
24 Jul 2015 12:41 PM
You should post the code so we can directly see/edit it..

Anchor the growing part.

local StartCF = Part.CFrame -- Outside loop
Part.CFrame = StartCF -- Inside loop
Report Abuse
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
24 Jul 2015 01:19 PM
local part = Instance.new("Part",workspace)
part.Anchored = true
part.Transparency = .5
part.CanCollide = false
part.CFrame = bomb.CFrame - Vector3.new(0,50,0)
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = BrickColor.new("Bright orange")
part.Shape = "Ball"
spawn(function()
for i = 1,200 do
wait(.025)
part.Size = part.Size + Vector3.new(4,4,4)
end
wait()
part:Destroy()
end)
Report Abuse
Fabunil is not online. Fabunil
Joined: 25 Oct 2013
Total Posts: 4325
24 Jul 2015 01:48 PM
local part = Instance.new("Part",workspace)
part.Anchored = true
part.Transparency = .5
part.CanCollide = false
part.CFrame = bomb.CFrame - Vector3.new(0,50,0)
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.BrickColor = BrickColor.new("Bright orange")
part.Shape = "Ball"
local cf = part.CFrame
spawn(function()
for i = 1,200 do
wait(.025)
part.Size = part.Size + Vector3.new(4,4,4)
part.CFrame = cf
end
wait()
part:Destroy()
end)


Also, please note that wait(.025) will always wait for more than .33 seconds, depending on the amount of lag in your game you may get erratic results.
Report Abuse
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
24 Jul 2015 10:53 PM
So if I'm understanding correctly, the cf = part.CFrame inside of the loop is basically resetting the cframe every time it repeats to make it stay in the same place, since increasing the size will make it move elsewhere?
Report Abuse
Fabunil is not online. Fabunil
Joined: 25 Oct 2013
Total Posts: 4325
25 Jul 2015 07:38 PM
yes.
Report Abuse
Explosive1x1 is not online. Explosive1x1
Joined: 11 Mar 2014
Total Posts: 356
25 Jul 2015 07:39 PM
add html



Hail The Master Language
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