Bear with me here, I absolutely despise CFrames. I know this is probably pretty basic stuff but let’s just say I’ve tried to avoid putting myself through this, so my understanding of it is limited.
Basically what I’m trying to do is place this gun in the NPC’s hand so that it will always face the guy in the black suit no matter where they are rotated.
Here is what it should look like at all times:
Here is what it looks like when I rotate them both 90 degrees (incorrect):
Here is the code that I used:
-- In the actual script, I got the position of it more complicated than just weapon.PrimaryPart.Position but there are no issues there so ignore that
-- weaponInfo.Rot is basically the LookVector that it's supposed to have, this is what doesn't work when I rotate the model
-- weaponInfo.Rot is set to Vector3.new(0, 0, -1)
weapon:SetPrimaryPartCFrame(CFrame.new(weapon.PrimaryPart.Position, weapon.PrimaryPart.Position + weaponInfo.Rot))
How can I set this so that weaponInfo.Rot is always the direction of the character on the right?
Like I said, my knowledge of CFrame is limited at best. If anyone could help me out here I’d greatly appreciate it.
No, it’s an animation that plays in different areas around the map, meaning different orientations. The gun gets rigged to the NPC by a script because there are multiple weapons with their own animations and orientations. Any way possible would be great. It doesn’t have to be like this as long as it works lol. I just want to get it over with
The motors are put on by script. I have all that down, the problem is that I can’t do it manually because there are many character models and many different weapons with different positions and animations that need to be assigned accordingly based on what the situation in the game is and where the NPC is around the map. The animation part itself is no problem.