0 votes

I'm making a 3D Game and I need to change my players size, when he goes trough an area, but I dont know how. I would be grateful if someone would explain me it. Thank u.

Godot version 3.4.1
in Engine by (12 points)

1 Answer

+1 vote

You change the scale variable. It's a vector2 or Vector3 depending on the node it's on.(Vector2 for 2D; Vector3 for 3D)
It would look something like this:

func _on_area_entered(area):
    scale *= 2 #this doubles the size of the node it's attached to.

func _on_area_exited(area):
    scale /= 2 #this halves the size of attached node.

Hope this helps!

by (69 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.