domzorg
(domzorg)
May 3, 2019, 6:53am
1
I have a class with a particle component.
The problem reside for editing the properties.
UCLASS(Abstract, Blueprintable)
class KSGM_API AKProjectile : public AActor
{
GENERATED_UCLASS_BODY()
…...
protected:
…….
/** The particle component */
UPROPERTY(BlueprintReadWrite, Category=Projectile)
class UParticleSystemComponent* ParticleComp;
When I set the var to BlueprintReadWrite, I cannot see the properties.
If I set the var to EditDefaultsOnly I can see the properties, but I cannot use the component in Blueprints.
/** The particle component */
UPROPERTY(EditDefaultsOnly, Category=Projectile)
class UParticleSystemComponent* ParticleComp;
What type should I use to be able to edit the properties and access the component in Blueprints ?
And why the component in encapsulated in a Particle Comp.
I have another class and the properties are not encapsulated in a Particle Comp.
UCLASS(Abstract, Blueprintable)
class KSGM_API AKSpell : public AActor
{
GENERATED_UCLASS_BODY()
…..
UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
class UParticleSystemComponent* ParticleComp;
Txs for your help,
D.
plangton
(plangton)
May 3, 2019, 6:56am
2
you need EditAnywhere in uproperty meta as well. usually alongside with BlueprintReadWrite.
detail explanation of all access meta tags can be found here A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums
1 Like
domzorg
(domzorg)
May 3, 2019, 8:36am
3
It doesn’t work.
I cannot see the properties
domzorg
(domzorg)
May 3, 2019, 9:09am
4
I’ve tried to delete the component from C++, recompile, launch the editor, compile the blueprint deriving from the C++ class, and save.
The I put back the component with another var name.
/** The particle component */
UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
class UParticleSystemComponent* ParticleSysComp;
Now I can see the properties of the component
And I’ve added a function to access the component.
/** Get the is playing in reverse or not. */
UFUNCTION(BlueprintCallable, Category = "Projectile")
class UParticleSystemComponent* GetParticleSystemComponent() const;
1 Like
plangton
(plangton)
May 3, 2019, 10:22pm
5
can you share you whole class code ?
domzorg
(domzorg)
May 4, 2019, 9:00am
6
The KProjectile class is the one that was causing the problem.
The KSpell owns almost the same type of components and was not causing the problem.
link text
I had the same problem and just changing the variable name in c++ and recompiling fixed it.
2 Likes
domzorg
(domzorg)
May 28, 2022, 7:18am
8
Thanks.
The problem disappears with the next version.
I cannot remember which version, since it was 3 years ago.
Actually I was having this issue in UE5.
MajorT
(MajorT)
June 17, 2022, 3:52pm
10
this issue accures when you hot reload inside visual studio.
1 Like
ImSeroga
(ImSeroga)
August 4, 2023, 2:04pm
11
When you compiling for the first time - Unreal remember UPROPERTY, so changing it later will not make effect. You need to rename component in C++, recreate blueprint or change parent class to something and then back to reinnit blueprint. I didn`t find good solution how to resolve this better without rebuilding blueprint manually but even this solution can help you
1 Like