Hello, I’m trying to make a top down game with characters like in this game:
I didn’t really work with custom characters yet so any help is appreciated.
Hello, I’m trying to make a top down game with characters like in this game:
I didn’t really work with custom characters yet so any help is appreciated.
Alright for that, all you need to do is create a localscript in the characterscripts folder in the explorer, with a piece of code that calculates a frame above the players head looking down ontop of it, and then setting the camera’s CFrame to that value.
local char=script.Parent
local rs=game:GetService("RunService")
local height=22--you can change this around a bit to see what you think looks the best
local cam=workspace.CurrentCamera
cam.CameraType=Enum.CameraType.Scriptable
rs.Heartbeat:Connect(function()
cam.CFrame=CFrame.new(char:WaitForChild("HumanoidRootPart").Position+Vector3.new(0,height,0),char:WaitForChild("HumanoidRootPart").Position)
end)
I was asking about how to make the characters.
I already have the topdown camera script.
Oh haha, my bad,
When the character is added, in a serverscript, you can just change the model for the character.
You can simply do that by executing:
player.Character=model
Just make sure your model contains all the right scripts (topdown camera for instance), a humanoid, and whatever else you may need that you’d normally have in the players character.
Another thing to keep in mind is to not make the event fire itself, otherwise you’ll be stuck in a loop of infinite character resetting.
I managed to make it work. Instead of doing the player.Character = model i just put it as a Starter Character.
That certainly works as well, look forward to seeing your experience.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.