How to let player control a model with regular controls?

I want to make a feature where the player uses WASD they move the model that they are looking at, currently I am not sure how to do this one bit, and I just need pointers into the right direction as of now.
I only have the camera following the model.

Along with this other side issue I’m having, I have a cloned model (this is what the player is controls) spawn when a player clicks the space bar, yet I want it to kinda push off, not just drop straight down (Shown below)


I tried to create this by when the model is created, a LinearVelocity is implemented but it had no change to how the model fell, aswell with zero errors.

Any suggestions on how to make a controlling system (and I’ve watched almost every video I have found for it so far, but none of them really work), and what would I use to give it a little push when the model is spawned into workspace.

local MakePoop = game:GetService("ReplicatedStorage"):WaitForChild("MakePoop")
local ChangeCam = game:GetService("ReplicatedStorage"):WaitForChild("ChangeCam")
local Poop = game:GetService("ReplicatedStorage"):WaitForChild("Poop")
local HideUI = game:GetService("ReplicatedStorage"):WaitForChild("HideUI")

MakePoop.OnServerEvent:Connect(function(player)
	local playersPoop = Poop:Clone()
	playersPoop.Name = tostring(player.Name).."_Poop"
	playersPoop.Parent = game.Workspace
	ChangeCam:FireClient(player, playersPoop.CamPart)
	
        -- here is where i made the linear velocity
	local LinearVelocity = Instance.new("AlignPosition")
	LinearVelocity.Parent = playersPoop.CamPart
	LinearVelocity.Visible = true
	LinearVelocity.Attachment0 = playersPoop.CamPart.Attachment
	LinearVelocity.MaxForce = math.huge
	LinearVelocity.MaxForce = playersPoop.CamPart.CFrame.LookVector * 100
	LinearVelocity.Enabled = true
end)

What I have right now

1 Like

You could use AssemblyLinearVelocity.

Object.AssemblyLinearVelocity = Vector3.new(0, 0, 3)

Just mess around with the vector3 till its in the direction you want.

Thnk you ! I did a little digging around on

and found :ApplyImpulse which works a bit better :+1:

Would you by chance have any idea on where to start with this ?

1 Like

When you create the character model, you could use it on the root part. So something like this

RootPart:ApplyImpulse(Vector3.new(0, 0, 3))

It also uses a vector3.

Oh no no, I had it working in my reply. Was just letting you know.

1 Like

Ohhh ok sorry, didn’t fully understand.

1 Like

Could you help me understand how you are currently making the model move? Or does it not move yet.

It doesn’t move right now except for the ApplyImpulse, which I did with

for _, v in pairs(playersPoop:GetChildren()) do
		if v:IsA("Part") then
			v:ApplyImpulse(Vector3.new(-3,0,0))
		end
	end

I have no control over it as it is just the camera attached to it.

ChangeCam.OnClientEvent:Connect(function(campart)
	
	RunService.RenderStepped:Connect(function()
		cam.CameraSubject = campart
		cam.CameraType = Enum.CameraType.Track
		--cam.CFrame = campart.CFrame
	end)
end)

This is what I have.

1 Like

Alright. Could you send me a screenshot of the contents of the model?

Once the script clones it into the game it looks like this
image

but before when it is waiting to be cloned it is this
image

Inside all the parts and WeldConstraints and Attachments
image

You could attach a sphere to the camera part with a ball socket constraint and then put an angular velocity into the sphere. Then you could constantly set the angular velocity using a script.

local Humanoid = Character.Humanoid
local MovementSpeed = 50

game["Run Service"].RenderStepped:Connect(function()
	
	local forwardMovement = Humanoid.MoveDirection.X
	local sideMovement = Humanoid.MoveDirection.Z
	
	Poop.MovementSphere.AngularVelocity.AngularVelocity = Vector3.new(sideMovement, 0, forwardMovement) * Vector3.new(MovementSpeed, MovementSpeed, -MovementSpeed)
end)

Where would I put this script & would I just change the RenderStepped line to if input.KeyCode == Enum.KeyCode.W then

Just remove the entire wasd checking thing, and put it there.

What do you mean by WASD checking ?

I have nothing in my code yet to have any control on it. It just clones the model into workspace and makes the player camera track it

I made this file of the model with some StarterCharacter stuff in it, would this sort of work ?

It doesn’t move too good though and gets stuck in the ground.

poopmove.rbxm (8.5 KB)

Heres a character model i created.
Test.rbxl (39.8 KB)

I made a new LocalScript inside of StarterGui named “Control” and put this in it.

It isn’t working, but I can’t seem to understand what woud be wrong with it ?

local player = game:GetService("Players").LocalPlayer
local playerName = player.Name
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input)
	local CalledPoop = playerName.."_Poop"
	
	if input.KeyCode == Enum.KeyCode.W and game.Workspace:WaitForChild(CalledPoop) then
		print("W pressed and Poop is in workspace")
		for _, v in pairs(game.Workspace:WaitForChild(CalledPoop):GetChildren()) do
			if v:IsA("Part") then
				v:ApplyImpulse(Vector3.new(3,0,0))
			end
		end
	end
end)

With the script i gave you, you still need to define the character. I just wasnt sure the path the it.