Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.
Projectile challengeram876Hello! In the bee last projectile challenge, I did not create a new state, but slightly redid the fire_projectile state:
```gdscript
var angle := 0.0
for i in projectile_amount:
var projectile: Projectile3D = projectile_scene.instantiate()
mob.add_sibling(projectile)
projectile.global_position = spawning_point.global_position
projectile.look_at(projectile.global_position + spawning_point.global_basis.z)
projectile.rotate_y(angle)
angle += 2 * PI / projectile_amount
```70Feb. 09, 2025
The bee gets stuck when chargeram876Hello! When I started the level after encoding the charge state, the bee was only twitching in place, I later found out that when charging, the bee collides with the box. This happens because the velocity vector is pointing slightly down (I disabled the bee's collision with the world). I've learned from experience that this happens during the chase state. Further, based on the previous module, I found out that it is necessary to assign zero to the desired velocity.y. Now the bee does not collide with the box and it rams the player successfully.10Feb. 09, 2025
ChargeAndShoot challenge - Projectiles's angle mathsKorielGreetings! So I had a go to this lesson's last challenge, and I came up with a very simple solution for spawning x amount of projectiles in a circle:
```gdscript
for i in projectile_amount:
var spawn_angle_increment := (2 * PI) / projectile_amount
var new_projectile := ProjectileScene.instantiate()
mob.add_sibling(new_projectile)
new_projectile.global_transform = mob.global_transform
new_projectile.rotate_y(i * spawn_angle_increment)
```
Then I went to check on the provided solution in the solutions project and - to me, someone with no maths knowledge whatsoever - seemed like a strange and overcomplicated solution which seemed to produce similar results but with more code.
```gdscript
var angle_interval := arc_angle / projectile_count
var half_arc := arc_angle / 2.0
for i in range(projectile_count):
var projectile := projectile_scene.instantiate()
mob.add_sibling(projectile)
projectile.global_position = mob.global_position
projectile.global_basis = mob.global_basis
projectile.rotate_y(half_arc - i * angle_interval)
```
I just can't figure out the exact reason to this approach, and I'd like to learn the why, since I imagine it does have a benefit that I'm not seeing.
Thank you!10Nov. 20, 2024
Not collidingRudiHi hi. I added a HitBox onto the bee, and I am doing the collision count `mob.get_slide_collision_count()` after the `move_and_slide`, but when it intersects the player, the player does indeed take damage. My expectation is that the bee would stop at that point, but it continues through the player and ends at the distance it would have normally finished.
How can I ensure that the collision does indeed work? In an earlier session, we set the bee's collider base collider to no layers.
I did add the player-level mask on the base Character3D collision section and that does work.20Oct. 01, 2024
Lesson Q&A
Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.