hey guys i hope someone can tell my why an object which hits the player tell me:
NullReferenceException: Object reference not set to an instance of an object
Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[ ] cacheKeyTypes, System.Object[ ] args, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
the player is an instance, the enemy is an instance.
well, shooting the enemy is the same method and it works, but if the enemy is shooting me i get this message.
here is the laser script from the enemy, it contains the var EnemyLaserDmg which should be send.
http://pastebin.com/aFX4AMir
and here the collider (tag == “Player”) which send the message to the ener_cal script
http://pastebin.com/Pg40kZ2N
as you can see the debug log show HIT PLAYER COLLIDER if “Player” is hit by the laser, and yes the debug log says: HIT PLAYER COLLIDER but hit.SendMessage(“SendLaserDmgToTarget”, EnemyLaserDmg); leads to NullReferenceException… so function SendLaserDmgToTarget(EnemyLaserDmg: float) isn´t called. and of course Debug.Log(“DAMAGE DELIEVERED!!!”); will never be called…but why?
so here´s the working example. the playerlaser script:
http://pastebin.com/7pLipbEy
and the enemy collider
http://pastebin.com/W58THdkB
this is 100% working and uses the same way
from player to enemy → works
from enemy to player → …error