Array of other objects with pointers

First of all, dangling raw pointers in UE4 can be dangerous because that way UE4 never knows if an object is still referenced in memory. UE4 uses it’s own system to support garbage collection (among many other things) and it does so with the uses of macros (like UCLASS, UFUNCTION, UPROPERTY, USTRUCT, etc)

Secondly, if you want array of something, using C style array over containers is pretty much always wrong. Use TArray instead, which is the Unreal 4 version of the std vector. So yes, you can use index accessor [] with TArrays.

So basically :

Instead of:

AGrid **GridLookup;

Use:

UPROPERTY()    
TArray<AGrid*> GridLookup;

After that, you will basically never have to use the “new” and “delete” operators in Unreal as they have their own allocation mecanism for UObjects and AActor. In your case, your AGrid class is an AActor( I assume, because of the ‘A’ in the name).

To spawn an AActor, you need to use SpawnActor.
Here is the documentation page :
Spawning Actors | Unreal Engine Documentation

An example useage in your case would be :

AGrid* myNewGrid = GetWorld()->SpawnActor<AGrid>();

I hope this is enough to get you going!

Mick