I created a SkeletalMesh object in the scene, and in the Editor I added a C++ component, but once I attached it to the SkeletalMesh I can't find out where it is in the Unreal panel. I know it's working, because after I attached the script to the object it prints some simple debug output.
The main reason I want to know where to find my script component is because I want to able to reference the SkeletalMesh the script is attached through the C++ in the same way you can in Unity with C#.
Is there a way I can reference the object my C++ script is attached to and access the SkeletalMesh values through C++?
My code is just a shell right now, but here I commented the places I want to create a reference to the SkeletalMesh and where I want to animate it:
#include "Glove.h"
// Sets default values for this component's properties
UGlove::UGlove()
{
PrimaryComponentTick.bCanEverTick = true;
}
// Called when the game starts
void UGlove::BeginPlay()
{
Super::BeginPlay();
// GET SKELETALMESH VALUE HERE SOMEHOW
}
// Called every frame
void UGlove::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// ANIMATE SKELETALMESH HERE SOMEHOW
}
To Referece SkeltaMesh to your script ,there is no way to do it like unity when you attach a script , however there is a way around.
But you have to make your variable in the Script public and editable inside blueprint to be able to set them at run time .
I had the same issue but was with blueprint only .