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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|