Hot answers tagged

29 votes

Enemy is losing 2 health instead of 1

I think you have twice as many components as you need here. While I'm generally in favour of small single-purpose classes, "have a health value" is so tightly linked to "modify health ...
  • 125k
1 vote

Unable to access an instanced health system

You have a variable private HealthButtons _healthButtons; in your GameHandler script, but you are not setting it to anything in code. And you wouldn't be able to ...
  • 115k
1 vote

How do I send data from client to server using LiteNetLib

You can use client.SendUnconnectedMessage(packet,peer.EndPoint) to send message to a fix endpoint - in your case the endpoint is the server.

Only top scored, non community-wiki answers of a minimum length are eligible