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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

SetWorldRotation does not work in 4.8

I can use SetWorldRotation or SetRelativeRotation properly in 4.7.6. When I update my c++ project to 4.8, everything does not work. my machine does not rotate their arms as well as before. I have noted some new "FORCEINLINE_DEBUGGABLE" functions there in SceneComponent, so what happen to my project? thanks! Please give some tips.

Product Version: UE 4.8
Tags:
more ▼

asked Jun 20 '15 at 09:02 AM in C++ Programming

avatar image

mylkrex
48 4 9 14

avatar image HungryDoodles Jun 20 '15 at 08:21 PM

Actually component->SetRelativeRotation must work for components.
Can you show lines with "FORCEINLINE_DEBUGGABLE" and SetRelative/WorldRotation?

avatar image mylkrex Jun 21 '15 at 03:21 AM
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshArm01;
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshArm02;
     
     ...
     
     RootComponent = RootScene;
     MeshChassis->AttachTo(RootComponent);
     MeshBody->AttachTo(RootComponent);
     MeshHook->AttachTo(RootComponent);
     
     MeshCabin->AttachTo(MeshBody);
     MeshArm01->AttachTo(MeshBody);
     MeshArm04->AttachTo(MeshBody);
     MeshArm02->AttachTo(MeshArm01);
     
     ...Tick Function
     
     MeshArm01->SetRelativeRotation(FRotator(60, 0, 0));
     MeshArm02->SetWorldRotation(FRotator(90, 0, 0));
 

I'm sure the code is executed in tick function, and it's a crane simulator, I have many staticmeshcomponent which attach their parent staticmeshcomponent.

avatar image HungryDoodles Jun 21 '15 at 06:28 AM

Looks fine... Maybe it is because rotator don't even changes, but it worked somehow in 4.7...
If MeshArms aren't in the same position as they was in 4.7, so maybe there is some changes in default settings for components. Setting component's bAbosoluteRotation false for arm01 and true for arm02 may do something.
What is actually (not) happening? What should happening?

avatar image mylkrex Jun 21 '15 at 09:20 AM

For MeshArm01, it does not rotate to (60,0,0) and stay (0,0,0). others are same. If you write this arms in c++, create a blueprint, and modify the angle in ConsturctionScript, then compile, nothing update... Reopen the blueprint, it will update.

I will compare the SceneComponent files, and go on figuring it out.

avatar image HungryDoodles Jun 21 '15 at 10:12 AM

Wow, I had the same problem in 4.7.
I know that it's strange, but try use MeshArm01->AttachParent = MeshBody and for everything else too instead of AttachTo.

avatar image mylkrex Jun 21 '15 at 10:55 AM

I'm sure it's a bug. You can create an AActor class, and create some UStaticMeshComponent, attach some other SMC.

Create a blueprint for it, assign staticmesh to them, it will not update, you have to reopent it.

Some other operation in ConstructScript is same issue.

 UCLASS()
 class SIMULATEGAME_API ATestArms : public AActor
 {
     GENERATED_BODY()
     
 public:    
     ATestArms(const FObjectInitializer& ObjectInitializer);
 
     virtual void BeginPlay() override;
     
     virtual void Tick( float DeltaSeconds ) override;
 
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         USceneComponent*    RootScene;
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshChassis;
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshBody;
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshArm01;
     UPROPERTY(VisibleDefaultsOnly, BlueprintReadWrite, Category = LLHCrane)
         UStaticMeshComponent*    MeshArm02;
     
 };
 
 // Sets default values
 ATestArms::ATestArms(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
 {
     RootScene = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("RootScene"));
 
     MeshChassis = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("MeshChassis"));
     MeshBody = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("MeshBody"));
     MeshArm01 = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("MeshArm01"));
     MeshArm02 = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("MeshArm02"));
 
     RootComponent = RootScene;
     MeshChassis->AttachParent = RootComponent;
     MeshBody->AttachParent = RootComponent;
     MeshArm01->AttachParent = MeshBody;
     MeshArm02->AttachParent = MeshArm01;
 }

avatar image HungryDoodles Jun 21 '15 at 12:37 PM

MeshArm->RelativeRotation = FRotator(60, 0, 0); Maybe that?
In my 4.8 project this works for camera location, maybe it needed for rotation too.

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

0 answers: sort voted first
Be the first one to answer this question
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