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)
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)
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)