So what I want to achieve is to a player(you) being able to control a model in the workspace with a humanoid in it, basically transfer your character to the model.
I already achieved that part by simply doing:
<Player>.Character = <Model>
And setting the CameraSubject to change to the model itself:
<Camera>.CameraSubject = <Model>
The issue here seems to be something related to range apparently.
As we can see in both images we can see the platform where the model I wish for a player to control is.
The only solution that worked so far for me is to literally place the model next to the player himself and guess what it does work I can indeed control the model, but since I wish it to be in another location with a custom map of its own, it doesn’t really help me a lot.
So resuming, I want be able to control a model by transferring the player.character to a model and I want be able to make it work from different locations, so the model itself and the player aren’t just like next to each other.
If anyone could help me out I’d appreciate it a lot.
I’m not understanding on how any of that would fix it. The issue here is just that if the model is close to the player I can control the model like I’d control the player character but if I place it on that platform the model doesn’t move at all.
Oh, you’d probably want to use Magnitude for that then? If you’re wanting to detect if the model is near the player, you could maybe do something like this in a LocalScript?
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HRP = Character:WaitForChild("HumanoidRootPart")
local Cam = workspace.CurrentCamera
for _, Model in pairs(workspace:GetChildren()) do
if Model:FindFirstChild("Humanoid") then
if (HRP.Position - Model.HumanoidRootPart.Position).Magnitude < 15 then
Character = Model
Cam.CameraSubject = Model
end
end
end
I believe your problem is that the player doesn’t have network ownership of the model.
The network ownership of unanchored parts close to the player’s character is automatically set to the player, so that’s probably why the model only works when close to the player’s character.
Not really that either ahahha. Thanks for sharing that might be useful in future scripts
But like let me explain it better. So I’ve created a menu and whenever you press the start button it changes from your character, basically it changes from you as the player to the model I want to control, but the issue here is that if that same Model is near you it works fine, like I can pretty much control if as if it was you controlling your own character (that’s the goal here), but whenever I place that same Model on the baseplate that it should be like seen in the pictures that baseplate away from the building, I can’t control the Model anymore which like I said the goal was to control it like you control your character.