How to make shield be in the correct position?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I am creating a Police Shield, similar to the one used in the game Prison Life.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that the shield is not connecting to the character properly. Though it does stay in place on the character’s arm, it is facing the wrong direction. My goal is for it to stand with the front facing the opposite side of the character’s torso, while it lies horizontally.
    image

  3. What solutions have you tried so far?

I have tried using this script:
Shield.CFrame = CFrame.new(Player.Character[“Left Arm”].Position, Player.Character.Torso.Position)
But it gave the same result as what I am using now. The forum only gave me results about forcefield shields.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

The shield should also sway with the character’s arms as it moves, and that part works right now with a weld.

local ShieldPickup = script.Parent
local Click = ShieldPickup.ClickDetector

Click.MouseClick:Connect(function(Player)
	
	local Shield = game.ServerStorage.Shield:Clone()
	Shield.Parent = workspace
	Shield.Anchored = false
	Shield.Orientation = Vector3.new(0,90,-90)
	
	if not Player.Character:FindFirstChild("Shield") then
		
		Shield.Parent = Player.Character
		local Weld = Instance.new("Weld")
		Shield.Position = Player.Character["Left Arm"].Position
		Shield.Orientation = Player.Character.Torso.Position
		Weld.Parent = Shield
		Weld.Part0 = Shield
		Weld.Part1 = Player.Character["Left Arm"]
		
	end
	
end)

Thank you a lot!

Do you attach it to some kind of a handle?

If you do, you should check if the part is orientated correctly by checking the faces of a part (front face should point the same way as front face of a shield, you can do that by adding decals and in their properties change the face they are shown)

If you don’t I recommend you to make one, just weld to the shield an invisible part smaller dimensions and then weld the hand to the handle.

Ohh, is there a way to change the front of an object?

Not that I know, the only way is to rotate it in the right direction. The simplest way is to create a handle, that’s how it’s usually done.

Oh, alright. Where would I put the Handle though? Like as the child of the shield, or somewhere else?

You would create a model in witch will be handle and a shield, then weld shield to the handle. Place a handle to where you want your hand to hold the shield. In a script you can weld the handle to the hand.

This works for the most part, but there is one problem. The handle isn’t directly connected to the arm. Though the handle moves with the arm, it is not near it at all.
image
image

I’d really appreciate some help, it’s very close to working!

script:
local ShieldPickup = script.Parent
local Click = ShieldPickup.ClickDetector

Click.MouseClick:Connect(function(Player)

if not Player.Character:FindFirstChild("ShieldModel") then
	
	local ShieldModel = game.ServerStorage.ShieldModel:Clone()
	local Handle = ShieldModel.Handle
	
	Handle.Parent = Player.Character
	ShieldModel.Shield.Parent = Player.Character
	Handle.Position = Player.Character["Left Arm"].Position
	local Weld = Instance.new("Weld")
	Weld.Parent = Handle
	Weld.Part0 = Handle
	Weld.Part1 = Player.Character["Left Arm"]
	
end
end)

You should clone the whole model to your character, don’t split it, and the weld0 should be hand and not handle as the hand is the part it’s welded to.

if not Player.Character:FindFirstChild("ShieldModel") then
	
	local ShieldModel = game.ServerStorage.ShieldModel:Clone()
	local Handle = ShieldModel.Handle
	shieldModel.Parent = character

	local Weld = Instance.new("Weld")
	Weld.Parent = Player.Character["Left Arm"]
	Weld.Part0 = Player.Character["Left Arm"]
	Weld.Part1 = Handle
	
end

Try now

1 Like

I’ve never felt such relief in my life. Thank you so much!

1 Like

No problem! If you need any help just tag me!

Also if you want to play around even more you can replace a weld with a joint (Motor6D). It’s the same as weld but it can be animated (if you want, for example punching or hiding animation). You should try it out.

if not Player.Character:FindFirstChild("ShieldModel") then
	
	local ShieldModel = game.ServerStorage.ShieldModel:Clone()
	local Handle = ShieldModel.Handle
	shieldModel.Parent = character

	local joint = Instance.new("Motor6D")
	joint.Parent = Player.Character["Left Arm"]
	joint.Part0 = Player.Character["Left Arm"]
	joint.Part1 = Handle
	
end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.