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: attempt to call method 'TranslateBy' (a nil value)

Previous Thread :: Next Thread 
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
05 Aug 2014 11:34 PM
I used it exactly like it's supposed to be used. This same piece of code has worked in the past and now it decided not to... Uhh... what's going on here?
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:35 PM
You tell me.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
05 Aug 2014 11:37 PM
Only works on models
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
05 Aug 2014 11:37 PM
:GetModelCFrame() isn't working either... This isn't funny guys. I'm on candid camera, right? Right guys? .... guys? GUYYYS!?
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:38 PM
Both of you aren't even using them right.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
05 Aug 2014 11:38 PM
Why dont you explain something for once then, you know, since youre the obvious genius here
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:39 PM
Oh, same person. You're not even using them right.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:39 PM
@Sensei, I can't explain if I don't even know what the problem with his script is. But I just know he isn't using it right, because I've been through this before.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
05 Aug 2014 11:41 PM
His problem is that he's either not using it on a model or he has defined it as something else
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
05 Aug 2014 11:41 PM
Post an example of the code you're using. I just tested both the methods you're having trouble with, and they work as expected.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:41 PM
Exactly, which means he isn't using it right. Now stop.
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
05 Aug 2014 11:42 PM
OH FRDJSFNSKJFNK I'M AN IDIOT! I WAS TRYING TO CALL TRANSLATEBY BY ON A MODEL'S CHILDREN, NOT THE MODEL ITSELF! I SWITCHED UP THE VARIABLES! D:


I'm just gonna sit in the corner and contemplate life now.
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
05 Aug 2014 11:43 PM
*TRANSLATYBY

I need to quit scripting/foruming late at night... These typos make me sound like an idiot. :|
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:43 PM
That's not a valid method.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
05 Aug 2014 11:43 PM
For parts, you can use part.Position = part.Position + Vector3.new(0,0,0) or part.CFrame = part.CFrame * CFrame.new(0,0,0)
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
05 Aug 2014 11:44 PM
It's ok; we've all had late-night brain farts.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:45 PM
You shouldn't get in the habit of using TranslateBy, or what above is doing(suuper sloppy)
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
05 Aug 2014 11:46 PM
Why wouldn't you? It's cleaner than finding the average position of the parts and then moving each part individually.
Report Abuse
Accomplishable is not online. Accomplishable
Joined: 13 Aug 2009
Total Posts: 6207
05 Aug 2014 11:49 PM
No. You can't use TranslateBy with big models, or it looks like they're all teleporting each one by one (In online mode). If you think PlaceRebuilder uses this for his models, you're wrong.
Report Abuse
tinarg is not online. tinarg
Joined: 18 Jun 2010
Total Posts: 4925
06 Aug 2014 12:15 AM
Well. these models I'm translating won't have more than 50 parts. They're player-made, and I've placed restrictions to prevent stuff like that from happening.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Aug 2014 02:08 AM
I don't see why you don't just use SetPrimaryPartCFrame.
TranslateBy and GetModelCFrame should be deprecated in favor for SetPrimaryPartCFrame and GetPrimaryPartCFrame.
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
06 Aug 2014 02:12 AM
The primary part isn't necessarily in the center of the model.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Aug 2014 02:16 AM
The primary part is something you set. There is no center of the model unless you physically define the start vector and the end vector and just divide them by 2.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Aug 2014 02:17 AM
And GetModelCFrame and MoveTo rely on the PrimaryPart, if none is found it probably returns some average CFrame/MoveTo. And the average is most likely not going to be the center.
Report Abuse
2eggnog is not online. 2eggnog
Joined: 08 Nov 2008
Total Posts: 1351
06 Aug 2014 02:23 AM
I did a quick test, and GetModelCFrame is not based on the primary part, nor is it the average position. It's the center of the the model's bounding box. Getting that information would be difficult otherwise, so there's no reason to deprecate that method.
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