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: SetPrimaryPartCFrame is inaccurate

Previous Thread :: Next Thread 
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
18 Jun 2016 12:06 PM
After like setting a position/rotation of a model like 3000 times, both the position and rotation are like 0.003 off.

How would I fix this issue?
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
18 Jun 2016 12:11 PM
It legitimate scenario would you set PrimaryPartCFrame 3000 times?


Report Abuse
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
18 Jun 2016 12:15 PM
I have an animation script that is constantly doing the same animation every few seconds.
It uses wait(), so approximately 30 times a second. Each animation is 100 frames.
Leave this script on for only 100 seconds, and the parts are offset.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
18 Jun 2016 12:19 PM
Try this

local StartPos = model:GetPrimaryPartCFrame()

--After the animation

if model:GetPrimaryPartCFrame ~= StartPos then

end

This will only work if it's some sort of repeating animation, not attached to a char or anything...
Report Abuse
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
18 Jun 2016 12:24 PM
The PrimaryPart is constantly on the same position and rotation, as it should be (no offset at all).

The parts in the model that are not the PrimaryPart are offset.

Should I use another method for this?
Report Abuse
TheGrayHat is not online. TheGrayHat
Joined: 02 May 2014
Total Posts: 523
18 Jun 2016 12:28 PM
@OP

Inaccuracy in representing long decimal numbers is just a part of programming. There's no sense in worrying about a tiny bit of offset that people won't even be able to see in the first place.
Report Abuse
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
18 Jun 2016 12:31 PM
I understand, wouldn't mind if it is a small offset, but letting the script run for like 10 minutes, it is offset like at least 1 stud.
Report Abuse
TheGrayHat is not online. TheGrayHat
Joined: 02 May 2014
Total Posts: 523
18 Jun 2016 12:32 PM
Why do you even need to SetPrimaryPartCFrame in the first place? If that part never moves, then would there be an issue if it's anchored?
Report Abuse
XandertjeKnal is not online. XandertjeKnal
Joined: 25 Feb 2016
Total Posts: 543
18 Jun 2016 12:34 PM
The model moves, also the Primary Part. When it moves back (a lot) you get an offset on the Model. The Primary Part has no weird offset.
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