Ref: My player change permanently his color with a modulate > 2 or 3
English - Espanol
Hello People I would like to report this thing that I think that this is a bug
I have one Game with 4 Scenes
1 Kirby(Player)
2 WaddleDEE(My Enemy)
3. Platforms
4. Main
the think is that I conect my Enemy with Kirby I wood like a transparency efect.
After like that I put a Timer in the Kirby Scene and it must conect with him (Kirby) yes is in Kirby and conect with kirby
I put a modulate.a well when I put the transparency 0.5 or 1 is perfect but if I say = 2 or = 3 well my player has a new color half white
func _on_Kirby_Timer_timeout():
modulate.a = 3
NOTE: if you put modulate.a = 1 or less it will be OK
Este bug se presenta en el script de Kirby osea el player al final dice
func _on_Kirby_Timer_timeout():
modulate.a = 3
Si fuera 1 o menor de 1 si regresa al color natural pero de lo contrario una vez toca al enemigo blanqueado
1 Scene kirby
extends KinematicBody2D
var movement = Vector2(0, -1)
var up = Vector2(0, -1)
var gravity = 9.8
var speed = 150
var hurt = false
func _ready():
pass
func _physics_process(delta):
movement.y += gravity
if Input.is_action_pressed("ui_right"):
movement.x = speed
$KirbySprite.flip_h = false
if is_on_floor():
$KirbyAnim.play("Walking")
elif Input.is_action_pressed("ui_left"):
movement.x = -speed
$KirbySprite.flip_h = true
if is_on_floor():
$KirbyAnim.play("Walking") #
else:
movement.x = 0
if is_on_floor():
$KirbyAnim.play("Idle")
if Input.is_action_just_pressed("ui_accept"):
if is_on_floor():
movement.y = -300
else:
false
if movement.y < 0 && is_on_floor():
$KirbyAnim.play("Jumping")
elif movement.y > 0 && !is_on_floor():
$KirbyAnim.play("Falling")
movement = move_and_slide(movement, up)
func _on_WaddleDee_body_entered(body):
modulate.a = 0.5
$Kirby_Timer.start()
func _on_Kirby_Timer_timeout():
modulate.a = 3
WaddleDee Scene
extends Area2D
func _ready():
pass
func _process(delta):
$WaddleDee_Sprite.play("Idle")

