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"

4.7.2 Exposing function to blueprints

Very similar problem already tracked here https://answers.unrealengine.com/questions/148775/46-hot-reload-upropertyufunctionbp-impl-events-do.html but closed as RESOLVED due no further investigation.

Detailed discussion is here https://forums.unrealengine.com/showthread.php?61329-Exposing-function-to-blueprints

I'm super noob and started playing around the engine just few days ago', so please point me out if i made something wrong.

Mainly, following the tutorial here https://docs.unrealengine.com/latest/INT/Programming/Introduction/index.html, some of us notice something going not in the right way. Seems to us that an explicit RESTART of the unrealengine editor is needed to see an update list of the UFUNCTIONs, with the right-click on blueprint editor.

version in use 4.7.2
os windows 7
visual studio 2013

1-open unrelaengine editor
2-open visual studio
3-rebuild code in visual studio
4-after rebuild terminated, unrealengine editor triggers HOTRELOAD
5-in blueprint editor, from right mouse botton, i'm able to see the function CalculateValues from Damage Category

6-change in visual studio the function CalculateValues from Damage Category to DamageTWO Category
7-rebuild code in visual studio
8-after rebuild terminated, unrealengine editor trigger HOTRELOAD
9-in blueprint editor,from right mouse botton, i'm NOT able to see the function CalculateValues from DamageTWO Category, even if something happens (the SETTER box highlight a label ERROR in red)

10-restart unrealengine editor
11-in blueprint editor, from right mouse botton i'm now able to see the function CalculateValues from DamageTWO Category, and SETTER box are without ERROR

HEADER:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "GameFramework/Actor.h"
 #include "MyActor.generated.h"
 
 UCLASS()
 class MYPROJECT_API AMyActor : public AActor
 {
     GENERATED_BODY()
     
 public:    
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
         int32 TotalDamage;
 
     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Damage")
         float DamageTimeInSeconds;
 
     UPROPERTY(BlueprintReadOnly, VisibleAnywhere, Transient, Category = "Damage")
         float DamagePerSecond;
 
 
     // Sets default values for this actor's properties
     AMyActor();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
     virtual void PostInitProperties() override;
 
     void  PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
 
     UFUNCTION(BlueprintCallable, Category = "Damage")
         void CalculateValues();
 };

SOURCE:

 // Fill out your copyright notice in the Description page of Project Settings.
     
     #include "MyProject.h"
     #include "MyActor.h"
     
     // Sets default values
     AMyActor::AMyActor()
     {
         TotalDamage = 200;
         DamageTimeInSeconds = 1.f;
     }
     
     // Called when the game starts or when spawned
     void AMyActor::BeginPlay()
     {
         Super::BeginPlay();
     }
     
     void AMyActor::PostInitProperties()
     {
         Super::PostInitProperties();
         
         CalculateValues();
     }
     
     void AMyActor::CalculateValues()
     {
         DamagePerSecond = TotalDamage / DamageTimeInSeconds;
     }
     
     #if WITH_EDITOR
     void AMyActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
     {
         CalculateValues();
     
         Super::PostEditChangeProperty(PropertyChangedEvent);
     }
     #endif
Product Version: Not Selected
Tags:
more ▼

asked Mar 09 '15 at 09:42 AM in Bug Reports

avatar image

enigmahc
11 1 1 5

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

1 answer: sort voted first

Hey enigmahc-

I was able to reproduce the problem you mentioned with the UFUNCTION() macro and have reported the bug to our internal tracking database (UE-11623) for further investigation. For the time being the simplest workaround does seem to be to simply close and reopen the editor. Best of luck in your project.

Cheers

Doug Wilson

more ▼

answered Mar 11 '15 at 02:21 PM

(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