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: Need help. Script isn't working the way I want it.

Previous Thread :: Next Thread 
MasterDoesMC is not online. MasterDoesMC
Joined: 31 May 2014
Total Posts: 31
05 Jul 2017 10:21 PM
So in my game, I'm making a kamehameha blast from scratch. I have my own animations and such. But the positioning of my waves aren't the way I want it to be. I want the cylinder (the wave) to have the top pointing out. So I told it to turn 90 degrees and other degrees, but its moving in other directions. If I could get some help, I'd greatly appreciate it.

Here's my script for the blast part:

-- Notes: c = the charging part, which is the ball that it shoots out of.

wait(2.2)
local b = Instance.new("Part")
b.Size = Vector3.new(2,2,3)
b.Parent = c
b.CanCollide = false
b.Material = "Neon"
local mesh = Instance.new("CylinderMesh")
mesh.Parent = b
mesh.Scale = Vector3.new(1,1,1)
b.Anchored = true
b.BrickColor = BrickColor.new("Electric blue")
b.CFrame = char.Head.CFrame * CFrame.new(0,0,0) * CFrame.Angles(-180,0,0)
g.Parent = b
Report Abuse
Niveum is not online. Niveum
Joined: 15 Aug 2009
Total Posts: 3437
05 Jul 2017 10:42 PM
CFrame.Angles automatically defaults to radians, not degrees

To do that you'd want to use math.rad() to convert your degrees to radians or just put in radians to start with:


CFrame.Angles(math.rad(-180),0,0)

Or

CFrame.Angles(-math.pi,0,0)


~ S P I C Y ~
Report Abuse
MasterDoesMC is not online. MasterDoesMC
Joined: 31 May 2014
Total Posts: 31
05 Jul 2017 11:02 PM
Thanks man, the math.rad() thing works. I haven't tried the math.pi one but, Thanks a lot for your help!
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