Am I Making a Frankenstein Game With Bad Casting?

I’m quite fond of getting references to specific objects in this manner:

AMyCustomClass* ObjectRef = ((AMyCustomClass*)ArrayContainingSomeStuff[CurrentItr]);

I’m of course referring specifically to the right side of that first line – the ‘((AActor*)TheActorI’mPointingTo’ bit. Is this casting? I am under the impression that this is just getting a direct reference to something I already have a hold of, or is this just nonsense I’m telling myself and it’s just another way of casting? I am performing this operation VERY frequently, too – will that catch up to me in performance or memory usage? And if it’s not casting, am I headed for disaster if the object I’m trying to assign a reference to ends up not being the class I put on the left side?

Now, here’s number two – how do I go about casting efficiently? I’ve heard that ANYTHING you cast to at ANY point in your code will be held in memory if the casting actor is present in the world – is this true? If so, when is casting ever viable at all and not just a train-wreck eventually? For instance, I heard a story of someone referencing a boss enemy class with a cast deep in their player animation BP code, and because the player has access to the BP from the get-go, the memory for the boss was being allocated in the menu. I know I should be adhering to event-based scripting, but how do I do event-based scripting without casting in the case of, say, needing to cast to a vehicle class when a player overlaps it and I want them to possess it to provide input, or not even possess it and just call input functions on it? I think if someone were able to give me a concrete example of the best way to handle this situation, it would clear up a lot of my other misunderstandings.

In this example, what should I do? Have a UInterface for all interactables in my game (it’s VR)? Or could I just do this with a universal ‘Use’ function in a parent ‘interactables’ class that they all derive from, and have that Use function triggered in each one with their correct response through a virtual void in the child interactables, like this?

void AMyVRHands::OnOverlapBegin(UPrimitiveComponent*, etc......)
AInteractableBase* ThisInteractable = ((AInteractableBase*)OtherActor);
if (ThisInteractable) ThisInteractable->UsePrimaryFunction;