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.
- 11
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c# × 8094unity × 5393
xna × 1398
2d × 450
monogame × 395
collision-detection × 315
physics × 266
xna-4.0 × 260
rotation × 224
camera × 173
movement × 173
3d × 171
mathematics × 162
animation × 150
gui × 146
input × 117
architecture × 109
vector × 106
shaders × 101
sprites × 99
android × 95
gameobject × 94
raycasting × 92
scripting × 91
textures × 89