Hello! I was following the tutorial as normal, until I got an error with the "get.viewport()" function. Godot is telling me that it "cannot find property 'viewport' on base 'Callable,'". Is there a way to fix this, or some library I need to inport perhaps?
When I shoot in the game, the bullets appear in the top left of the screen, and when they touch the left wall I get an error saying that take_damage is not defined. Any idea what could be causing this?
Set collision layer and mask for the wall so that bullet don't collide with it. But if you want it to collide then, In the bullet script, before calling the take_damage function check if the body is enemy, then only call the take damage function
You need to calculate the vector from bullet position to mouse position.then use this direction to move the bullet. You can use look_at() function to rotate bullet images
Hello! I was following the tutorial as normal, until I got an error with the "get.viewport()" function. Godot is telling me that it "cannot find property 'viewport' on base 'Callable,'". Is there a way to fix this, or some library I need to inport perhaps?
Nevermind, I figured it out!
When I shoot in the game, the bullets appear in the top left of the screen, and when they touch the left wall I get an error saying that take_damage is not defined.
Any idea what could be causing this?
Set collision layer and mask for the wall so that bullet don't collide with it. But if you want it to collide then, In the bullet script, before calling the take_damage function check if the body is enemy, then only call the take damage function
@@dicode1q OK thanks! I'll try it out when I have time for it.
How would I make the bullet follow the mouse?
You need to calculate the vector from bullet position to mouse position.then use this direction to move the bullet. You can use look_at() function to rotate bullet images
@@dicode1q thanks I’ll try it. Good video btw it helped me a lot