Skip to content

raycast fails when destroying/recreating entity #789

@blackberryshortcake

Description

@blackberryshortcake
import ursina

app = ursina.Ursina(window_type="none")

ground = ursina.Entity(model="plane", collider="mesh", scale=1000)
print(ursina.raycast(ursina.Vec3(5, 15, 0), ursina.Vec3(0, -1, 0)).hit)

ursina.destroy(ground)

ground = ursina.Entity(model="plane", collider="mesh", scale=1000)
print(ursina.raycast(ursina.Vec3(5, 15, 0), ursina.Vec3(0, -1, 0)).hit)

results in

True
False

but surely both should be true.
This is on Ursina 7.0.0 but also happens on current master 97797d6.

PS Since I keep running into issues involving destroy involving level reloading (= destroy the previous level and create a new level), do you have any suggestions on what I could do differently?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions