x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

SetActorScale3D C++ not working

Super similar post: https://answers.unrealengine.com/questions/73617/why-doesnt-scaling-an-actor-with-child-actors-work.html

I have a C++ class, it is a UActorComponent. I created a blueprint and attached my custom component and a static mesh. The custom component calls GetOwner() and updates the actors scale using SetActorScale3D (). The actor visibly has the new scale value in it's properties, BUT, the actual static mesh is the same size. That is to say, the static mesh does not graphically scale even though the actor's properties scale has changed.

For example, the scale will read as ~(0,0,0) but the static mesh will be at full size (1,1,1).

All components are Movable.

Any ideas?

Product Version: Not Selected
Tags:
more ▼

asked Nov 20 '14 at 03:15 AM in C++ Programming

avatar image

viperld
20 8 9 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I've created a work-around(?). It's not fully tested so idk if this fix has any quirks. That being said...

     //
     FVector new_scale = FVector(3,3,3);
     AActor* das_owner = GetOwner();
 
     //
     TArray<UActorComponent*> components;
     das_owner->GetComponents(components);
     for (int32 ii = 0; ii < components.Num(); ++ii){
 
         //    Scale us.
         //
         USceneComponent* sc = Cast<USceneComponent>(components[ii]);
         if (sc){
             sc->SetRelativeScale3D(new_scale);
         }
     }

This manually crawls though each component and, if applicable/possible, manipulate's it's scale directly.

This is being called BY a component on an actor, to effect every component on the actor.

more ▼

answered Nov 20 '14 at 03:36 AM

avatar image

viperld
20 8 9 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question