Hello, I’m making a Star Wars game and would like to make a system where you can buy droids to follow you around. I am currently using AlignPosition and AlignOrientation to get the droids to follow their owners around.
However, there are still some bugs such as I need help fixing, specifically:
- Droid not interacting with environment correctly (e.g part collisions)
- Not sure how to add offset so the droid isn’t inside the player’s leg
- And how would I correctly use AlignOrientation correctly to get the droid to rotate the correct way?
Code is below, I am using PlayerAdded for now for convenience.
game.Players.PlayerAdded:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Droid = game.ServerStorage.Astromech:Clone()
Droid.Parent = Character
local PlayerAttach = Character:WaitForChild("RightLowerLeg"):WaitForChild("RightAnkleRigAttachment")
local PartAttach = Droid:WaitForChild("Main"):WaitForChild("Attachment")
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.Parent = Character:WaitForChild("RightLowerLeg")
AlignPosition.Attachment0 = PartAttach
AlignPosition.Attachment1 = PlayerAttach
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Parent = PlayerAttach
AlignOrientation.Attachment0 = PartAttach
AlignOrientation.Attachment1 = PlayerAttach
end)