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 » Scripting Helpers
Home Search
 

Re: Can someone fix this?

Previous Thread :: Next Thread 
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
08 Jun 2013 09:03 AM
local p = Game.Players.LocalPlayer
local c = p.Character
local cam = Workspace.CurrentCamera
local neck = c.Torso.Neck

local base = neck.Part0.Position + (neck.C0.p*1.5)
local YVec = (cam.CoordinateFrame.p + cam.CoordinateFrame.lookVector*100)
local set = CFrame.new(base, YVec)
local oS = set:toObjectSpace(c.Torso.CFrame * neck.C0)
neck.C1 = oS

I want it to only control UP/DOWN and not left/right. It glitches when it goes left and right.

How would it so this only controls up and down? (Y axis? Although I'm not sure since what I tried with .Y doesn't work)
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
08 Jun 2013 09:44 AM
Someone please help me, I don't know how to do it ._.
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
08 Jun 2013 10:45 AM
Bump
Report Abuse
redfart is not online. redfart
Joined: 17 Oct 2008
Total Posts: 1021
09 Jun 2013 01:04 PM
Bump
Report Abuse
iceywind is not online. iceywind
Joined: 10 Aug 2009
Total Posts: 4424
09 Jun 2013 01:06 PM
I'll fix it.
Here you go:

local p = game.Players.LocalPlayer
local c = p.Character
local cam = Workspace.CurrentCamera
local neck = c.Torso.Neck

local base = neck.Part0.Position + (neck.C0.p*1.5)
local YVec = (cam.CoordinateFrame.p + cam.CoordinateFrame.lookVector*100)
local set = CFrame.new(base, YVec)
local oS = set:toObjectSpace(c.Torso.CFrame * neck.C0)
neck.C1 = oS

Sorry if this doesn't work.

Making ROBLOX Better, One Forum Post at a Time™.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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