AttachActorToActor Causing Attached Mesh To Be Inversely Scaled, the result varies between PIE, server, client, and editor

Dear Friends at Epic,

In this thread I am discussing 1 particular function:

Actor.h

UFUNCTION(BlueprintCallable, meta=(FriendlyName = "AttachActorToActor", AttachLocationType="KeepRelativeOffset"), Category="Transform|Actor")
void AttachRootComponentToActor(AActor* InParentActor, FName InSocketName = NAME_None, EAttachLocation::Type AttachLocationType = EAttachLocation::KeepRelativeOffset);

#Repro

I did the following

  1. Had a rotating looping skeletal Mesh with sockets moving around in circle constantly
  2. Dragged this skeletal mesh into the level as a skeletal mesh actor (not a character)
  3. Had a SMA in the level already
  4. In level blueprint, did a snaptoTarget AttachActorToActor to make the SMA follow one of the sockets of the skeletal mesh

#Rotating Skeletal Mesh FBX For You on DropBox

Here’s my exact asset on dropbox if you wish to use it for testing.

The only socket/bone I’ve tested with is Top

NathanLyer/AnimatedPlatformCircularFlying.FBX

Enjoy!


#No Socket Relative Scaling

The relative socket scale for the socket that the SMA is getting attached to is 1,1,1, no scaling at all


#My Results in Current Build

Because my original skeletal mesh was pretty small from 3ds max, I needed to massively resize it in the level, about 10 times bigger, still only 1/3 of what was really needed

The bigger I made the skeletal mesh actor, then when I played the level, the smaller the attached actor became.

This resulted in me having to make the original SMA HUGE just so it would not get scaled down too small to stand on.


so I am noticing an inverse scaling of the attached actor to the scaling of the Skeletal Mesh Actor


Here’s the size I made the mesh in Editor, so it would not scale down to invisible in PIE

Here’s the scaling that occurred automatically in PIE

Here’s my level Blueprint


#Multiplayer, Very Different Scaling

Then I took the exact same setup, did not change the level at all

and Ran my usual server / client instance as a listen server and a client

#Server,
the SMA became really really small, smaller than PIE, and any other previously seen size

#Client,
the SMA did not become as small as in PIE, it maintained original size of the editor


#None of This Scaling Happens via C++ When Done to a Character

When I run this function via C++ NO SCALING OCCURS AT ALL

but I am doing the function on a Character’s Mesh, not a skeletal mesh actor


#What is All This Weird Non-Replicating Scaling?

I’ve never seen this before, it never happened with all of my tests in C++ with a character as basically a wrapper for the rotating skeletal mesh


I embarked upon these tests because of this thread:
https://rocket.unrealengine.com/questions/7844/creating-complex-rotating-skeletal-mesh-platform-r.html

Rama

Hi Rama,

Thank you for your report. I am looking into this issue, but I am getting different results when I PIE. I imported the AnimatedPlatformCircularFlying(APCF) FBX with animation and added a socket. Then I placed the APCF SkeletalMesh in the level and gave it the Animation Sequence data (set to looping). After connecting a SkeletalMesh to the “Top” bone’s socket via the Level Blueprint, I scaled the APCF using the Scale widget tool. I then launched a listen server with client, but the attached object maintains the same size for both views. Is there anything about what I have done that is different than your reproduction?

There is a chance that something else in the project is altering the scale behavior. If you create a new code project, import the fbx and set up the scene anew, does the result change?

Thank you,

Alexander

Thank you for taking the time to look into this!

So you’re saying that no scaling of attached object is occurring for you at all?

The attached object is the same size in editor and in PIE?

Also I was attaching a static mesh actor to the top socket via level blue print, not a skeletal mesh,

I will try skeletal mesh actor and see what results I get currently

Ideally a static mesh actor needs to be used since that is the one that will have proper collision for being a platform

Thanks Alex!

Rama

oh and btw I like your acronym APCF hee hee :slight_smile:

Rama

I just got same results with a skeletal mesh actor

going to try a new project now :slight_smile:

Congrats Alex!

I can confirm that the non-replicating resizing is not occurring with a new code third person project

oddly I could not get the third person character to base on the attached static mesh actor

but whatever the case

the weird non-replicating issue does appear to be an issue specific to my current project

If I figure anything else out about it I will let you all know

Thanks Alex!

Rama