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: Why isnt this pointing in the direction of the camera correctly

Previous Thread :: Next Thread 
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:01 PM
x,y,z = character.Head.CFrame:toEulerAnglesXYZ()
x2,y2,z2 = workspace.CurrentCamera.CoordinateFrame:toEulerAnglesXYZ()
Weld.C1 = CFrame.Angles(-x + x2,-y + y2,-z + z2)

If I am correct, this SHOULD point towards the camera. I guess by those means I am wrong.

When the y-axis goes negative, all the controls flip, except for the y-axis. Any way to fix this? I can take video to show you the problem, if you have an XF
Report Abuse
mustyoshi2 is not online. mustyoshi2
Joined: 11 Feb 2008
Total Posts: 6129
13 Jul 2011 06:04 PM
CFrame.new(character.Head.Position,workspace.CurrentCamera.CoordinateFrame.p)
That points from the head to the camera, probleme?

~Monica
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:04 PM
The y-axis being 'side to side' if you will
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:05 PM
late post, let me read
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:06 PM
ah, my bad. I ment to say have the same rotation as the camera
Report Abuse
mustyoshi2 is not online. mustyoshi2
Joined: 11 Feb 2008
Total Posts: 6129
13 Jul 2011 06:07 PM
Uh... I don't know what you mean by that, maybe tell me what you're trying to make with this?

~Monica
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
13 Jul 2011 06:07 PM
[ Content Deleted ]
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:11 PM
A brick facing the same direction as the camera is.

I am trying to simulate that with welds, but not having much success.
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:12 PM
It doesnt? Can you explain for me, then, oysi?
Report Abuse
mustyoshi2 is not online. mustyoshi2
Joined: 11 Feb 2008
Total Posts: 6129
13 Jul 2011 06:13 PM
So weld.C1 = workspace.CurrentCamera.CoordinateFrame+(workspace.CurrentCamera.CoordinateFrame.p-weld.Parent.Position);
You might have to change the second part to negative or something... Idk.
~Monica
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
13 Jul 2011 06:16 PM
[ Content Deleted ]
Report Abuse
mustyoshi2 is not online. mustyoshi2
Joined: 11 Feb 2008
Total Posts: 6129
13 Jul 2011 06:16 PM
I like my complex way better.

~Monica
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:18 PM
Thanks. But I'd like to know why my way did work so I can avoid it next time.
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 06:19 PM
my way didnt* work
Report Abuse
mustyoshi2 is not online. mustyoshi2
Joined: 11 Feb 2008
Total Posts: 6129
13 Jul 2011 06:21 PM
For one, you're using the angles from an object that has no relation to the other object...

~Monica
Report Abuse
rulzalot is not online. rulzalot
Joined: 05 Jul 2009
Total Posts: 6305
13 Jul 2011 07:26 PM
Uhm excuse me, but none of these worked, and in term I did my own trouble shooting. I came to find that the objects y-rotational axis was being doubled and found the reason was, was because since I was using a weld, the y axis came out to be the heads rotation + the other objects rotation. Therefor causing it to double, like I mentioned before. How do I combat this problem?
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