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"

Component loses values

I have a component derived from Point Light Component. Also, there is one property that I added. I can put it into blueprint as a component and this object in the scene works fine. Point is that when I change any component value in the blueprint asset and restart editor or recompile the project all properties reset.

Here is my .h component code:

 #include "CoreMinimal.h"
 #include "Components/PointLightComponent.h"
 #include "MyActorComponent.generated.h"
 
 
 UCLASS(Blueprintable, ClassGroup = Lights, hidecategories = Object, editinlinenew, meta = (BlueprintSpawnableComponent))
 class COOLSHOOTER_API UMyActorComponent : public UPointLightComponent
 {
     GENERATED_BODY()
 
 public:    
     // Sets default values for this component's properties
     UMyActorComponent();
 
     UPROPERTY(EditAnywhere, Blueprintable)
         int integer;
 
 protected:
     // Called when the game starts
     virtual void BeginPlay() override;
 
 public:    
     // Called every frame
     virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
 
         
 };

There is nothing in ccp, so I don't post it.

As a result, I want to be able to set default values for a component inside blueprint;

Product Version: UE 4.22
Tags:
more ▼

asked Apr 16 '19 at 07:39 PM in C++ Programming

avatar image

Dlitte_Wacken
8 1 2

avatar image Lardo Deepdelver Apr 16 '19 at 07:51 PM

Did you try to recreate the component, I had a similar problem and the only thing that fixed it was deleting the component adding it again save.

avatar image Dlitte_Wacken Apr 16 '19 at 08:23 PM

I didn't, but it happens with any component I create. I tried to create 4 different components in 3 different projects.

(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