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: Insert service model lost name and primary part

Previous Thread :: Next Thread 
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
08 Jun 2016 06:39 PM
When I insert a model from the insert Service it's no longer named Interactable and doesnt have a primary part
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Jun 2016 06:51 PM
local asset = game:GetService("InsertService"):LoadAsset(assetId):GetChildren()[1].Parent

problem solved.
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Jun 2016 06:52 PM
**local asset = game:GetService("InsertService"):LoadAsset(assetId):GetChildren()[1]
Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
08 Jun 2016 07:35 PM
I still need it to be named, and [1] can be anything from a int value to another model
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Jun 2016 07:48 PM
Just try my solution
Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
08 Jun 2016 09:13 PM
Casual it doesnt work for the hierarchy that is required for my game. Thank you though
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Jun 2016 10:19 PM
Seriously, that's the answer. When you upload things to roblox they get wrapped in a model.
I.e. if you highlight and upload multiple parts, LoadAsset will return then inside a model object.

So if you upload a model, it gets wrapped inside another model.
This can quickly be verified by inspecting the model the hierarchy
I.e. :LoadAsset().Parent = workspace. You'll see the model you want the first child of the model parented to workspace. Information isn't being lost
Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
08 Jun 2016 10:41 PM
Oh, my, god. That is the dumbest thing ever. Why do they do that?
Report Abuse
Casualist is not online. Casualist
Joined: 26 Jun 2014
Total Posts: 4443
08 Jun 2016 10:59 PM
It's weird for LoadAsset to return variadic arguments (either single objects or tables of objects) so it was likely decided to return one object. Now it'd be weird if they didn't wrap all uploaded objects in a model because then it'd be hard to discern which models where wrapped and which weren't. So they just package everything as one model, and once you know this you know you have to unwrap everything LoadAsset returns.
Report Abuse
Hedr0n is not online. Hedr0n
Joined: 05 Jan 2016
Total Posts: 1524
09 Jun 2016 12:14 AM
Yeah I thought about that came back here and saw you already wrote my words. Well I got it working now thanks to you, thanks

For your help and making me feel dumb :)
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