Hello Developers, I’m just asking for a way to teleport the stand model behind me every time the remote fires, and it does not matter where I’m facing.
When I face for example, “East”:
It will go behind me as I want,
but when I face any other direction for example, “North”:
It will not go behind me. What I want is to make the stand go behind me every time the remote gets fired, no matter where I’m facing.
Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
local AbilityOneRemote = ReplicatedStorage.Remotes.AbilityOne
local UserPoseAnimation = ReplicatedStorage.Animations.UserPose
AbilityOneRemote.OnServerEvent:Connect(function(Player)
local PlayerCharacter = Player.Character
local PlayerHumanoid = PlayerCharacter.Humanoid
local PlayerStand = ReplicatedStorage.Stand:Clone()
local StandCallSound = SoundService.OtherSFX.GoldExperience:Clone()
local StandSummonSound = SoundService.OtherSFX["GE-Summon"]:Clone()
local StandEffect = ReplicatedStorage.Effects.GiornoStand1.Middle:Clone()
StandCallSound.Parent = PlayerCharacter.Head
StandSummonSound.Parent = PlayerStand.Torso
StandEffect.Parent = PlayerStand.Torso
local UserPose = PlayerHumanoid:LoadAnimation(UserPoseAnimation)
UserPose:Play()
StandCallSound:Play()
wait(0.15)
StandSummonSound:Play()
PlayerStand.Parent = PlayerCharacter
local primaryPart = PlayerStand:WaitForChild("HumanoidRootPart")
local offsetBehindPlayer = Vector3.new(-1.5, 0, 2.5)
local function updateStandPosition()
local playerPosition = PlayerCharacter.HumanoidRootPart.Position
primaryPart.CFrame = CFrame.new(playerPosition + offsetBehindPlayer)
end
updateStandPosition()
local weld = Instance.new("WeldConstraint")
weld.Part0 = primaryPart
weld.Part1 = PlayerCharacter.HumanoidRootPart
weld.Parent = primaryPart
wait(0.35)
StandEffect:Destroy()
end)
The lookAtOffset is meant to be adjusted as the comment I made says. Try setting it to Vector3.new(-1.5, 0, 0) and the problem should be fixed although if you change the offsetBehindPlayer value you will need to adjust it again to correct the angle
That’s a very good suggestion so nice work dude! I tested it though and found that it doesn’t offset the stand to the right or left though so for that you’ll need to adjust the code to be like this:
Thanks for the help, yall. I fixed it my way by adding a hitbox part once the player joins and welding the hitbox behind the player, then setting the player model position to that hitbox.