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: CFrame help

Previous Thread :: Next Thread 
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:01 PM
I need some help with CFrameing
ex
game.Workspace.Part.CFrame = CFrame.new(0,1,0)

That will SET it to 1 but how would i just ADD 1 to its current position?
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
13 Dec 2011 08:02 PM
game.Workspace.Part.Position = game.Workspace.Part.Position + Vector3.new(0,1,0)
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:02 PM
I want CFrame not position.
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
13 Dec 2011 08:03 PM
Change .Position to .CFrame if you want overlapping bricks.
Report Abuse
TwoBoo is not online. TwoBoo
Joined: 08 Feb 2011
Total Posts: 10790
13 Dec 2011 08:03 PM
Oh right, my bad.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:04 PM
Okay thank you!
Report Abuse
natjdog09 is not online. natjdog09
Joined: 16 Jan 2010
Total Posts: 1370
13 Dec 2011 08:06 PM
"I want CFrame not position."

Just do this:

game.Workspace.Part.CFra=me = game.Workspace.Part.CFrame + Vector3.new(0,1,0)

I am pretty sure it'd work, if not then tell me.

Hope this helps.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:08 PM
I tried this but it didn't work


game.Workspace.Part1.CFrame = game.Workspace.Part1:pointToObjectSpace + Vector3.new(0,1,0)
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:09 PM
Umm I think I did that wrong.
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
13 Dec 2011 08:11 PM
Eh, I think you should look at this:

http://wiki.roblox.com/index.php/CFrame
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
13 Dec 2011 08:11 PM
You did.

You need to call the part's CFrame before using :toObjectSpace.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:12 PM
I'm trying to CFrame it on local axis.. :c
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:13 PM
So

game.Workspace.Part1.CFrame = game.Workspace.Part1.CFrame:pointToObjectSpace + Vector3.new(0,1,0)

tried that and still no beans. :ccccc
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
13 Dec 2011 08:13 PM
You call pointToObjectSpace on a CFrame and set its argument to a Vector3.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:15 PM
I'm trying to get kinda liek the local axis so if y axis is rotaed 50 deg and i make it move up by 1 on y then
it will move in a 50 deg tilt.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:16 PM
I feel like a brainless fool.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
13 Dec 2011 08:39 PM
My god... So simple and none of you could do this ;c?


Part.CFrame = Part.CFrame * CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0,0,0)



First set of (0,0,0) Will controll position. It will move from the bricks current CFrame

Second set of (0,0,0) Will controll rotiation. You can use things math.rad(45) to give rotations in degrees.

Just as an example. to move the Part 3 studs on the X axis, and 2 Studs on the Y axis, then Turn it 45 degrees (Y axis) It would look like this.

Part.CFrame = Part.CFrame * CFrame.new(3,2,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(45),0)
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:39 PM
e = game.Workspace.Part1.CFrame = CFrame.new:pointToWorldSpace(1,1,1)

print(e)

Got this in output
21:39:00 - Workspace.Script:1: unexpected symbol near '='
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:42 PM
How do I use
CFrame:toObjectSpace(CFrame)

CFrame:pointToObjectSpace(Vector3)

:s
Report Abuse
aldrich777 is not online. aldrich777
Joined: 29 Jan 2011
Total Posts: 173
13 Dec 2011 08:45 PM
Cool bro.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:46 PM
If your not going to help
GO AWAY.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:51 PM
part = game.Workspace.Part

part.CFrame = part.CFrame * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)

This seems to work but I don't know why. :s

Wouldn't it be + not * :ssss

I feel even more like a idiot then I did befor.

Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
13 Dec 2011 08:54 PM
Directly from the wiki


CFrame * CFrame -- returns composition of two CFrames
CFrame * Vector3 -- returns Vector3 transformed from Object to World coordinates
CFrame + Vector3 -- returns CFrame translated (slid) by Vector3
CFrame - Vector3 -- returns CFrame translated (slid) by -Vector3
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
13 Dec 2011 08:56 PM
Wtf is slid?

Sorry for me knowing so little about CFraming
It's alwas so hard for meh. :c
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
13 Dec 2011 09:00 PM
Everyone learns, it's okay for having some frustration and questions about it.

Slid is basicly moving a part so far on the specified axis.

part.CFrame = Vector3.new(0,0,3) -- is going to move it 3 studs on the Z Axis from it's workspace position, not the bricks CFrame.
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