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. 

Extended CameraComponent does not Tick?

Hi,

I want to extend CameraComponent to have a custom transform but for some reason it doesn't tick.

My Code:

 UCLASS()
 class MYGAME_API UMainCharCamComponent : public UCameraComponent
 {
     GENERATED_BODY()
     
 public:
 
     FTransform OldTransform;
     
     FTransform NewTransform;
 
     virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
     
 };

CPP

 #include "MyGame.h"
 #include "MainCharCamComponent.h"
 
 
 void UMainCharCamComponent::TickComponent(float DeltaTime, ELevelTick TickType, 

 FActorComponentTickFunction* ThisTickFunction)
     {
         Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
               //SOME CODE
     }


Inside the Constructor of MainCharacter.cpp

 ThirdPersonCamera = CreateDefaultSubobject<UMainCharCamComponent>(TEXT("ThirdPersonCamera"));

Is there a reason why this custom CameraComponent doesn't tick?

Cheers,

Product Version: Not Selected
Tags:
more ▼

asked May 04 '17 at 08:43 PM in C++ Programming

avatar image

Bionic Ape
129 16 20 24

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

1 answer: sort voted first

I think you have to set

 PrimaryComponentTick.bCanEverTick = true;

in the constructor.

more ▼

answered May 04 '17 at 09:23 PM

avatar image

DennyR
1.1k 31 12 47

avatar image Bionic Ape May 04 '17 at 09:52 PM

Thanks, I can't believe I forgot about this.

avatar image DennyR May 04 '17 at 09:56 PM

glad I could help. :)

(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