TMap Hashable KeyType

Hey,

I am trying to use a TMap with a struct as the key. The struct is a collection of ints. I need to provide a custom key to get it to work.

I have tried to follow the TMap docs and having absolutely no luck getting it to work, so was hoping someone could explain how to do this.

It’s been a few weeks since I asked this, and I finally figured it out by combing through the vector structs.

For anyone who might also have this problem:

In your struct you need to add a operator override== , and then outside your struct, a GetTypeHash. My mistake was using the GetTypeHash inside my method.

ie

struct FStructName
{
    int x;
    int y;

     bool operator==(const FStructName& a) const
    {
        return x == a.x && y == a.y;
    }
}
// end of struct

FORCEINLINE uint32 GetTypeHash(const FStructName& b)
{
	return FCrc::MemCrc_DEPRECATED(&b, sizeof(FStructName));
}

There is a non-deprecated version of that Memcrc, but since epic are using it in all theirs, I just went with it.

I have a translucent sphere that the player can pass into and out of. But when I pass into the sphere, I can’t see it anymore from the inside. Is there a way to make a material that would allow me to see the sphere even when I pass into it? kissmanga