Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Strange behaviour with 2 spatials in Entity
  • Don't know if this is a bug, or if I missed something. I have an Entity with two collision spatials (different names) in it, both non-simulated, with collision shapes and controlled with the same renderer. If I move the Entity in the builder, one spatial stays static. If I click on the static one seperately in the builder (yes, in the builder, not ingame) - it starts moving like crazy and escapes from screen...

    The reason for two spatials is, that the Entity has one detection-spatial for the find in range action (which seems to require a spatial as range-reference) and a smaller hit-spatial for something like shots/arrows to collide with it.
  • 1 Comment sorted by
  • Ok, I think a got a solution.

    1. I created an additional ShapeRenderer for the second CollisionSpatial (I guess it is supposed that each CollisionSpatial has it's own renderer).
    2. The first Renderer loses it's CollisionSpatial-assignment in the moment a new one gets added, so I had to reassign it to the old one.
    3. The Entity has to be selected in the Layer-tab or with a square-selection to get all the spatials in it, if they are on top of each other - otherwise you will only get one and ruin it's position to the others when moving.

    What could be done to make this easier:
    A. Maybe an option to tie multiple spatials inside the same entity together should be added, so that you move all when moving one. There position to each other can still be regulated with the offset-settings.
    B. The deselection of a CollisionSpatial in a renderer could be switched off, when adding a new one.
    C. Adding a little warning in the builder, that it is not possible to control two CollisionSpatials with one Renderer - just in case someone like me wants to try that ;)
    D. In regard to what I was trying to do (having a hit-zone and a different detection-zone CollisionShape in the same entity), it would be the easiest thing to allow the multiple CollisionShapes in one spatial not only to have different ShapeSettings but also different ObjectTypes.

    EDIT: That a Renderer loses it's CollisionSpatial-assignment in the moment a new one gets added doesn't seem to happen every time. I couldn't figure out the circumstances for that so far.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion