inherited component is offset from intended actor location

As you can see in the image, the audio component is offset from the static mesh component, which isnt like the blueprint class that they are inherited to; the audio component would always be spawned at location (0,0,0) [I moved it around in the image]. I tried using SetupAttachment, AttachTo, and AttachToComponent, but the ways ive tried them didnt change the position of the audiocomponent.

Solutions/references and explanations would be nice, and thank you beforehand.

1 Like

Also, have you checked the transforms/location of the components in the BP class? Are their locations all (0,0,0)?

Without some code, it’s going to be hard to pinpoint the problem.

greetings! i shouldve posted my code, but I tried starting the whole thing over. basically, I just did the standard create a an actor class, make it inherit a staticmesh and audiocomponent. The static mesh was used for the rootcomponent, and I tried using the said functions in the main question. but to have move specifications, for the FAttachmentTransformRules, i used KeepRelativeTransform. I made sure all the components had a location of 0,0,0 in the blueprint, and i had no other location modifying code.

okay, so I tried making a new project and did the same thing, and its working as intended now. the audio component is spawned at the same location in the world that i place my actor.

1 Like