C# custom attributes

Suppose you do not want always check the distance between player and some object and instead of it you just want to mark your function like [DistanceAttribute(2f)] where 2f is allowable distance and your function will be runned only if that distance between player and object will be Less or Equal of 2 and method will run automatically without any “if” over and over.

Continue reading

Networking on Unity 5 (source code)

There is a basic setup of FPSController from Standart Assets, and my Sync Transform Script, you can use it your own project, it’s allow you to Synchronize Position and Rotation of Character, and also the Camera.

You can make your gun as child of the Camera transform and then it will be synchronized over the network. My FPS on the vid is crap (cause my laptop is too op) but it has 0 latency without any recordings.


Continue reading