get the parent for a specific game object instance * Get the parent for a game object instance. * * @name go.get_parent * @param [id] [type:string|hash|url] optional id of the game object instance to get parent for, defaults to the instance containing the calling script * @return parent_id [type:hash|nil] parent instance or `nil` * @examples * * Get parent o
| 1252 | * |
| 1253 | */ |
| 1254 | int Script_GetParent(lua_State* L) |
| 1255 | { |
| 1256 | Instance* instance = ResolveInstance(L, 1); |
| 1257 | Instance* parent = dmGameObject::GetParent(instance); |
| 1258 | if (parent != 0) |
| 1259 | { |
| 1260 | dmScript::PushHash(L, parent->m_Identifier); |
| 1261 | } |
| 1262 | else |
| 1263 | { |
| 1264 | lua_pushnil(L); |
| 1265 | } |
| 1266 | return 1; |
| 1267 | |
| 1268 | } |
| 1269 | |
| 1270 | /*# gets the game object instance world position |
| 1271 | * The function will return the world position calculated at the end of the previous frame. |
nothing calls this directly
no test coverage detected