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"

Blueprint Actor Component Not Ticking

I am pretty much at the end of my rope with this.

I have a C++ Base Class that derives from UActorComponent, and I cannot get it to tick.

Here is what the base class constructor looks like:

 UAC_HardLightComponent::UAC_HardLightComponent()
 {
     PrimaryComponentTick.bCanEverTick = true;
     PrimaryComponentTick.bStartWithTickEnabled = true;
 }

The Tick has a call as follows (as it is being overriden)

 Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

I am not overriding the Event Tick in my blueprint class, which means it should default to the base class implementation, right?

This wouldn't be nearly as frustrating, if Unreal didn't keep crashing on me. Enabling the Component to Tick in the Blueprint Editor causes Unreal to crash. Does anyone have any ideas?

Product Version: UE 4.20
Tags:
more ▼

asked Mar 12 '19 at 07:56 PM in C++ Programming

avatar image

Varun MS
1 1 2

avatar image PasteteDoeniel Mar 12 '19 at 09:55 PM

May seem like a stupid solution, but did you forget the "Super::BeginPlay()" in BeginPlay? If BeginPlay doesn't work, then the Tick won't work either.

I ask this, because with what you have shown I don't see how your code wouldn't work.

maybe this will help

Tick function not firing in Actor Component driven class.

avatar image Varun MS Mar 12 '19 at 10:01 PM

I do have it:

 void UAC_HardLightComponent::BeginPlay()
 {
     Super::BeginPlay();
     
     GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Yellow, TEXT("Testing BeginPlay!"));
 
     DaggerState = EDaggerState::DS_NoDagger;
     PrevDaggerState = DaggerState;
 
     //SetComponentTickEnabled(true);
 }

BeginPlay seems to work alright, it's just the Tick.

(comments are locked)
10|2000 characters needed characters left

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