Can I send struct in event? Or other way?

I wanna send structure using Event, but I don't know how to add new type in CustomTypes. And are there other ways without structure send Vector2 and Integer in one event?(For economy traffic) or you think better send it in two different events?

Comments

  • Hi @RandomMan,

    you can always send multiple values with just one RPC or RaiseEvent call. Since Vector2 is already registered as a custom type you can use this as well.

    If you want to register your custom type you should follow the example in this guide and extend it so it fits your needs. Basically you just need to add the int value in the Serialize and in the Deserialize function and increase it's byte count to 3 * 4 (you still have two float values and an additional int value).