tbh i don’t really understand how your script works, if you don’t loop assigning the position then the pet will never follow you.
But I don’t want it to move??
I am using positions and WeldConstraint for a reason. If I wanted the dam pet to follow the user I would not have WeldConstraint in place. The issue is not when the player walks it is when the player spawns one when they are at the angel then it will not spawn the way they are looking but away.
You can use welds instead and modify the attachments orientation like in the post I sent to orient it properly lol to face forwards.
Welds give more control over orientation then weld constraints. Weld constraints I find buggy if the characters are moving.
How many times do I need to state inside this dam post I do not want the pet to folllow the character.
The reason I have WeldConstraint in place is so that the pet stays on the character shoulder. The issue I am having is if you add the pet when ur at an angel it will not face fowards but at a diffrent angel.
I already told you this, you can not have parts anchored if you’re welding something.
Will I still not have the same issue? Even if I welded it to an attachment will it not just face any direction??
I will look into what your stating.
It will face which way you oriented the attachment.
Understandable, then use motor6d.
You can’t weld smthing to an attachment??
You use it’s CFrames from the attachment according to the CFrame formula lol
Me laughing at this badly worded post leading to 30+ replies
I am also replying to 10 other people at the same time
But I don’t understand how this will make it face fowards.
[CFRAME] : CFrame (roblox.com)
- Positional
CFrame* , short for coordinate frame , is a data type that describes a 3D position and orientation. It is made up of a positional component and a rotational component. It includes essential arithmetic operations for working with 3D data on Roblox.
- Rotational
CFrame stores 3D rotation data in a 3-by-3 rotation matrix . These values are returned by the
CFrame:GetComponents
function after the X, Y and Z positional values. This matrix is used internally when doing calculations involving rotations. They use radians as their unit (for conversion to degrees, usemath.rad
/math.deg
).The matrix below represents the components of a CFrame’s rotation matrix and their relationship with the various vector properties available (LookVector, RightVector, etc). Although the individual components of the rotation matrix are rarely useful by themselves, the vector properties which derive from them are much more useful.
How how will that help me? I want to make sure to pet is above the shoulder as well. How could I do this??
You set the CFRAME of your pet to the attachment that you created to your characters HumanoidRootPart for example.
EDIT: Weld, then set pet CFRAME to attachment.
But will it not just face any direction not the way the player is facing??
An attachment on default will always face forward depending on where it has been created. (Unless the orientation was changed.)
No it won’t because it uses the attachments CFrames to position it relative to each other.
First you do @deOrcus setup, get the attachment position, you do it visually with an attachment
Then you setup the pet attachment, where you want it to connect
Then you folllow the weld formula to position both of these together with the help of attachments
Weld.Part0 = torso.Attachment.Parent
Weld.C0 = torso attachment.CFrame
Weld.Part1 = sword.Attachment.Parent
Weld.C1 = sword.Attachment.CFrame
Weld.Parent = anything under workspace -- sword or torso can work
Replace sword and torso with, pet and HumanoidRootPart.
local weld = Instance.new("Weld")
weld.C0 = hrpPetAttachment.CFrame
weld.Part0 = hrpPetAttachment.Parent
weld.C1 = petAttachment.CFrame
weld.Part1 = petAttachment.Parent
weld.Parent = char
Even a modeler can do it, haha
Test file within, local starter character scripts:
WeldTest.rbxl (43.1 KB)
The benefit of this method is that if your model or mesh is not orientated properly you can just rotate the attachment.
From this at orientation (0,0,0), enable attachment visible under constraints menu to see the axis of the attachment.
To this (0, 90, 0)
Leading to a new pet orientation:
You could do this purely with CFrames without creating attachments but they greatly help in visualizing how welds work for people who don’t understand them and are more visual and can be adjusted for each pet model that is created.
- Fantastic explanation!
Although, I’d have done this myself. I think giving the user a chance to fix it themselves is sometimes a better learning experience.
But I guess, this is a more… Special case