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: How can I change a CFrame position without using CFrame.new?

Previous Thread :: Next Thread 
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 10:47 AM
If I use CFrame.new(Vector3.new(x,y,z)), the part's rotation becomes 0. So I want to change a part's CFrame Position without changing the rotation. How could I do it?
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
25 Nov 2011 10:49 AM
part.CFrame = part.CFrame + Vector3.new(x, y, z) - part.CFrame.p
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 10:52 AM
I never heard of .p
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 10:54 AM
Thanks, I discovered a new property xD
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 11:00 AM
Oh, errors:

Output: p cannot be asigned to

What's wrong? I've never seen that error before.
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 03:12 PM
Bump...
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
25 Nov 2011 04:16 PM
This is what i use:

part.CFrame = part.CFrame + Vector3.new(x, y, z)
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2011 04:27 PM
That adds a Vector3 value to the actual position. I want it to change to a position... Like this:
part.CFrame = CFrame.new(Vector3.new(x,y,z)) --But this changes the rotation too

Not this:
part.CFrame = part.CFrame + Vector3.new(x,y,z)

That's the problem I want to change the CFrame position without changing the rotation.
Report Abuse
Wil2 is not online. Wil2
Joined: 01 Feb 2008
Total Posts: 728
25 Nov 2011 04:44 PM
try this:
part.CFrame = part.CFrame*CFrame.new(x,y,z)
Report Abuse
YodaimeKing is not online. YodaimeKing
Joined: 01 Nov 2009
Total Posts: 3961
25 Nov 2011 04:46 PM
I reccomend the CmdUtl its like.. AWSOME!!1
Report Abuse
agent767 is not online. agent767
Joined: 03 Nov 2008
Total Posts: 4181
25 Nov 2011 04:53 PM
sncs script was correct.
You propablyy tried to change CFrame.p and that`s why the script errored.


vector = Vector3.new(x,y,z) <----- the new position of the part
part.CFrame = part.CFrame + vector - part.CFrame.p
Report Abuse
STEVEN1952 is not online. STEVEN1952
Joined: 13 Apr 2009
Total Posts: 145
25 Nov 2011 05:49 PM
theresis like 2 difffernts ways i think Vector,MoveTo
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
26 Nov 2011 03:52 AM
Thanks, it worked :D
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