rdInst Tutorial 12 – Finding our Actor from an Instance (HitResult)

At times we want to get back to the owning Actor of an Instance where we have it’s index – a good example is when it has been returned as a HitResult.

rdActor has a couple of methods built in for this, rdGetrdActorFromInstanceIndex() and rdGetStaticMeshFromInstanceIndex().


Step 1. Create the Instance example from Tutorial 5

We’ll use the same Instances as we were in Tutorial 5, so just follow the steps there to create the Blueprint. Then again, like Tutorial 11 we add the Box Collisions, just for something to trigger with.


Step 2. Add a LineTrace

We’ll just focus on the first box, it’s just a simple example of running a LineTrace and Finding the HISMC, the StaticMesh and the rdActor that the hit Instance belongs to:


Step 3. Done

That’s it – this is positioned so it will always hit the Shelves, so returns us as the actor, and the shelves StaticMesh.