Hi all,
First of all, I apologize for any confusion in my question, either from my terrible English or poor explaination.
My idea is to write a separate scence_component so that when attached to a staticmesh, will act onto that staticmesh (for this case, adding force to it). Itself will also have a static_mesh component, so that during runtime the scene_component itself can interact with the included static_mesh. I call this wheel_component.
Next I created a pawn, with a staticmesh as defaultRoot, then attach wheel_component on to it as children:
StaticMesh
-Wheel_Component1
-Wheel_Component2
In the cpp file of the wheel_component, I have variable to reference the staticmesh like this:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
UStaticMeshComponent* rigidbody;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
UStaticMeshComponent* wheel_mesh;
When creating the parent pawn with visual scripting editor, how can I reference the parent mesh component “rigidbody” and set the mesh for “wheel_mesh”?
If the current plan is not possible, should I change the current wheel_component from scene_component to actor? Then attach “wheel_mesh” as a component? Or what would be the best way to implement my idea?
I was a Unity developer just switched to Unreal due to work requirement. My mindset currently is still heavily based on Unity’s workflow. My plan for this setup is to create a separate wheel component that handles its own force calculation based on the input fed from the parent pawn. It will also handle its own visual movement by modifying the included staticmesh (wheel_mesh). In Unity, this is done by creating new GameObject for each wheel, then attach wheel_component script onto it. The rigidbody is referenced by either search_by_component or drag_drop. Same with wheel_mesh. Also wheel_mesh would be a separate gameObject with mesh component attached.
Thank you guys very much.