Model not appearing in workspace when i start the game

Hello. I recently made a scripted monster model which basically makes the monster appear when player touches a trigger part. I believe the script works perfectly fine, but for some reason, the model doesn’t appear in the workspace when i start the game. Like its just not there in the workspace when i start. I tried getting the model closer to the spawn and just make a script that will teleport the model to its position, but this also doesn’t work. I can’t really give any images, as it is self explanatory. Help would be really appreciated.

1 Like

Not really self explanatory if you don’t show us the script. :slight_smile:

Is the monster CanCollide false and dropping through the map?

Try using Run instead of Play or Play here for testing and watch for the monster model in your Explorer window. If it is there then check to see its Position (or just use the Move tool and you’ll see the move drag arrows around it).

1 Like

As @Scottifly mentioned, it’s impossible to answer without seeing the code. However, as suggested, it could be an unanchored model or, alternatively, you might have cloned the model without defining the Parent that contains it. If you post the code, I’m sure we’ll find the issue.

1 Like

Alright, here are all the scripts that are connected with the smiler.

wait(5)
local Smiler = game.Workspace.SmilerScripted
local SmilerTrigger = game.Workspace.SmilerTrigger

SmilerTrigger.Touched:Connect(function(SmilerTrigger)
	game.ReplicatedStorage.SMilertriggered:FireServer(workspace)
end)

game.ReplicatedStorage.SMilertriggered.OnServerEvent:Connect(fuction(Triggered)
game.Workspace.SmilerScripted

type or paste code here

wait, sorry i accidentally pressed reply

the second one is

game.ReplicatedStorage.teleportlvl0.OnServerEvent:Connect(function(smiler)
	game.Workspace.SmilerScripted:MoveTo(game.Workspace.SmilerTriggerDestination)
end)

I don’t understand whether the first script is a LocalScript or a server-side script. FireServer is used from the client to the server (if it’s a server-side script). However, if it’s a LocalScript, it might not be executed inside the model. Additionally, I suggest rewriting the code in a more organized manner and using WaitForChild to ensure that the object has actually been created.

-- Use task.wait instead of wait (which is deprecated). WaitForChild ensures the object exists
task.wait(5)
local Smiler = game.Workspace:WaitForChild("SmilerScripted")
local SmilerTrigger = game.Workspace:WaitForChild("SmilerTrigger")
local destination = SmilerTrigger.Position

-- The first argument of the Touched event is the part that actually touched the trigger.
-- You don't need a reference to the trigger itself, as you already have it in a local variable.
SmilerTrigger.Touched:Connect(function(hit) 
	Smiler:MoveTo(destination)
end)

-- I don't think you need an event and another script since you're already working on the server side.

Try this. Hope this will work

Alright, so i modified it a little bit to work, and it does go to the part, but it ends up higher than i excpect, clipping trough the ceiling. Here’s my modified code and also a video showing the result:

task.wait(5)
local Smiler = game.Workspace:WaitForChild("SmilerScripted")
local SmilerTrigger = game.Workspace:WaitForChild("SmilerTrigger")


SmilerTrigger.Touched:Connect(function(hit) 
	Smiler:MoveTo(Vector3.new(64.25, 15.625, 70.303))
end)

(For some reason, the video wont upload AND the website i paste videos in ALSO doesn’t work. So i had to put this in a mediafire file, sorry The Video

Instead of manually defining a position, create an invisible and non-collidable part to place at the point where you want it to move, and use the position of this target object. In theory, it should move to that point without any issues. Also, from the video, I can’t quite tell where the Smiler starts and where the trigger is. Could it be a collision issue perhaps?

I think it might be a collision issue, i tested it outside the map, although it still teleports, the monster gets exactly where the part is, but when i put him in the hallway, he clips on the ceiling. The ceiling has no collision, also the part where it is extremely dark in a hallway is where the smiler is, just not visible because the dark hallway is a black block with no collision

If you want, you could consider a different approach. You could place the Smiler inside ServerStorage and create a Spawner object that clones it and places the clone at the spawner’s position. I’m not sure if this would be useful for you, but it’s another solution.

task.wait(5)
local spawner = .--spawnerposition in the game
local Smiler = game:GetService("ServerStorage"):WaitForChild("SmilerScripted")
local SmilerTrigger = game.Workspace:WaitForChild("SmilerTrigger")


SmilerTrigger.Touched:Connect(function(hit) 
    local clone = Smiler:Clone()
    clone.Position = spawner.Position
    clone.Parent = game.workspace
	clone:MoveTo(Vector3.new(64.25, 15.625, 70.303))
end)

The smiler doesnt seems to spawn, i never worked with clones before so idk

and @Glitched_Byte
MoveTo (click the link) puts a Model in place, but if there’s a collision then it’ll move it up.
Try PivotTo as the link suggests.

1 Like