Can someone help me with the formatting on a script?
I know exactly what I want to happen but I don’t really know how to code. I was hoping someone could make this script for me so I can see the realistic format that applies to what I am trying to do.
Basically I want a self standing script that can be reused many times.
The Idea is that if one game object comes into contact with the other it starts to take enemyDamage which is playerDamage once per second(not sure how to implement seconds). playerDamage is a simple public variable predefined on the script, say 5. There is the health variable, let’s say 100. so here is the path:
if collision = true
then apply enemyDamage
enemyDamage = playerDamage(get playerDamage from colliding object)
health = 100
playerDamage=5
I am not sure how to check if two objects are colliding or not. Would I have to split this script into more than one script to fit in collision?