I am creating a tycoon and was able to make a script that handles all buttons. Occasionally, when I set a union's parent to the TycoonModel, it would show on the screen but your character can walk through it (cancollide is true). In addition, theres one union that involves a ClickDetector in it and when I hover my mouse over it the cursor icon does not change (visible to the screen).

This occurs when I run a test server.

This is how I clone the models:

local objects = {}

for _, v in pairs(model:GetChildren()) do
	if v:IsA("Model") then 
		objects[model.Name] = v:Clone()
	end
end

Inserting the model:

local targetmodel = model

if objects[targetmodel.Name] then 
	objects[targetmodel.Name].Parent = TycoonModel
end

2 comments

0

note that this bug occurs randomly. If there is no fix I will have to work my way around this and create a regular part, set the transparency to 1 and cancollide to false and position it to the union's position

0

I thing the error is on the second part of the script, line 4 - TycoonModel isn't defined as anything, i thing you want to use game.Workspace.TycoonModel