I’m new to Unreal Engine and there is a thing that i can’t resolve. I created an UCapsuleComponent to detect walls.
But i can’t edit it in the Editor :
Hey! thnaks for the reply but it seems that it is not working I think that there is a real issue because i tried many tags but none of them did the job …
I see you’ve already done some trouble shooting, but I just did a quick test using a blank project in 4.17 and was able to edit a c++ inherited capsule component from blueprints. Maybe there is an issue with the accessibility of the variable or something. It’s peculiar for sure, but hopefully you might get some insight from my tests. Image and code below.
// MyActor.h
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Components/CapsuleComponent.h"
#include "MyActor.generated.h"
UCLASS()
class LEARNINGCPP_API AMyActor : public AActor
{
GENERATED_BODY()
// An example capsule component
UPROPERTY(VisibleDefaultsOnly, Category = "Components", Meta = (AllowPrivateAccess = "true"))
UCapsuleComponent* MyCapsule;
// Other code.....
}
// MyActor.cpp
#include "MyActor.h"
AMyActor::AMyActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
MyCapsule = CreateDefaultSubobject<UCapsuleComponent>(TEXT("MyCapsule"));
MyCapsule->InitCapsuleSize(80.f, 110.f);
MyCapsule->SetupAttachment(GetRootComponent()); // Attach to the default root
}
Try making a new blueprint out of that c++ class, other than that i’m not seeing any reason why it’s not working. The rest of the components are working fine?
Thanks for answering It always help ! But I found out that the autogenerated code from the first person shooter template automaticaly creates a FirstPersonCharacter bp class which has MyCharacter as parent. In this case, the walldetection will not be editable.
But if I create a bp class from MyCharacter, it works !
It’s a tricky relation but I need to understand it, in order to spawn a “MyCharacter” instead of a “FirstPersonCharacter”
And an other thing, if I spawn a “Mycharacter”, it doesn’t fire projectile like the “FirstPersonCharacter”.
It’s weird because both bp classes have MyCharacter as parent.