@mdswamp said:
Hi Twisted :)
first of all, Thank you for all your assistance
No problem! I'm happy to try and help :smile:
second, Im using Godot v2.1.5, godot 3 does not support my old Graphic card :wink:
Ah, okay! Good to know. It's been awhile since I've used Godot 2, but when I saw set_trigger
, I realized that the project could be using Godot 2 and not Godot 3 like I assumed.
Good to know the output is (for the most part) like you would expect. As for the straight punches not working, it's hard to say, but it means the Area2D
node's body_entered
signal is not being triggered. It could be that the fist (left or right) does not leave the opponents head, and so it does not trigger another body_entered
signal because the body never exits.
But it's hard to say. The fact that the side collisions makes me guess the problem is the Area2D
node is not noticing the fists hitting when it's straight. You may be able to check and see if this is happening by moving the player's far enough apart where the fits can only hit when going straight, therefore (in theory) the fists should enter the Area2D
and send the body_entered
signal, and then sent the body_exited
when they leave.
Breaking them out into separate scenes sounds reasonable, though you can (probably) work using one scene if you want to. It may just be the code or scene needs some tweaking.
You should be able to do something like this (it's been awhile since I've used Godot 2.0, but I think this should work):
"Obviously you are not using a Node2D, but this is just for example!"
extends Node2D
"This makes it where you can set the path to the Area2D in the editor!"
export (NodePath) var path_to_area
"We'll store the area for later use (optional)"
var other_area_in_scene;
func _ready():
"We can use get_node and that will put the Area into other_area_in_scene"
other_area_in_scene = get_node(path_to_area);
"We can connect signals using the connect function"
"The first argument is the name of the signal we want to connect. The second argument is the"
"object whose function we want to call, and the third argument is the function that is called when the"
"Signal is emitted"
other_area_in_scene.connect("body_entered", self, "other_area_body_entered")
"Then we can react to the signal like normal!"
func other_area_body_entered(body):
print ("Something hit the other area!")
ok, another thing happens when i hit colon/period key (colon/period belong to player1). when collision happens, i see this in output:
It depends on where the print statement is, but I would guess what is happening is when one player is punched, at some point one of the hands (or something) in the other player hit the original player, making it seem like both players have been hit. It's hard to say for sure though, but that is what I would guess is happening.
It's been awhile since I've used Godot 2, so I'm not sure how helpful my help will be :lol: Hopefully it helps and gives you an idea on how to fix the problems!