A few months ago i implemented my first battle grid in 2D topdown.

Now i want to change some things but cant seem to figure out some things.

1: When creating a Battle Grid, it does not show properly in scene view, this meaning that for some reason all the gameobjects (with sprites on them) are rotated -90 on the x axis. Since i use sprites to render the objects, they are invisible unless i change it back to 0 for each Battle Grid Cell Component .
Is there a way to make the generate grid button not put a rotation of -90 on the x axis?

2: In the past i made it so the player got to choose the party placement using the Player Grid Placement node in my start battle event. I would like to automatically place the players party, and enemies, on the grid based on their current position. I thought the Place On Grid node would be good here, but i dont think i use it correctly, as the combatants do get spawned but they do not seem to be "on the grid" since they can not move etc. The player also does not get placed on the nearest cell, but more like the center of the battle grid.

You can see the event here: https://imgur.com/a/oKkI0jU

Any idea what i might do wrong? Is this the correct way of doing this? Or is there a simpler way to put certain characters/gameobjects that are defined in a Battle in the scene in a grid battle?

3: A small followup on the previous question, it is possible for the player group to be destroyed (and spawned again after the battle). How would i handle this best for characters that are already in the scene and not in the party group? I tried the Destroy Object node with Actor set to Enemy Group, but it didnt seem to do anything.

I know this is a big post, sorry for that
thanks in advance, as always!
  • There've been a lot of updates for grids in 2D in the latest ORK version 2.31.0 (and general making 2D easier with one centralized horizontal plane setting in the game settings).

    1) This should no longer be a problem when using the XY horizontal plane and regenerating the grids.

    2) Disable Use Deployment Cells if it's enabled - otherwise the combatants will only use deployment cells instead of any free cell. Maybe use a Wait node (with 0 second wait to continue in the next frame) to give Unity time to spawn the combatants before placing them.

    3) The Destroy Object node is the way to go, when using the Enemy Group it'd destroy any already spawned enemy. Like with #2 it's probably best to add a 0 second Wait to give Unity time to destroy the game objects, though.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks for your quick reply, as always!

    1) It is already on XY horizontal plane in game settings. I am on version 2.31.0 already. Though i think i have a way of fixing this another way.

    2) I already disabled the use deployment cells, the wait helped tho! Now the player and enemies get placed on the grid, however the player somehow keeps moving in the direction he triggered the battle. Player control is disabled in the event, and does get disabled when i look in the inspector, is there any way to say he should not move (i am using build in top down controller). This same behavior happens when the player for example interacts with a character for dialogue.

    3) Thanks! ill look into it.
  • 1) Also check if your cell prefabs are rotated the correct way :)

    2) Are you using a custom control? If so, it might not reset the movement vector when it gets disabled by ORK - you'd either have to add that in an OnDisable function or e.g. use a wrapper between ORK and the component.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I use the built in top down 2d controller.
  • Hm, I'll check that, might be that it's not doing it :)
    Though, destroying the player group before placement (i.e. spawning all combatants again) should solve it for now.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • The problem with that is that they dont get spawned on their last position, but in the center of the grid. This was something i already tried.
  • Checked it and the 2D controller doesn't stop, so it's a bug - will fix it in the next update :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Great thanks!
Sign In or Register to comment.