I'm making a game where the player has one overworld unit that moves around and can enter grid based battles in another scene that use the whole party, excluding the overworld unit. My game start event has the overworld unit join the active group, then leave the battle group, and hide member after that. In the grid battle, the first unit always has components for Character Controller and Player: Button Controller (disabled). This first unit will also get misaligned from the grid sometimes after moving.
image
It doesn't happen after every single move, but it only happens to the unit that gets those components.
  • Try setting the combatant to the cell's position at the end to make sure it's placed on the cell - might be that the move just gets stuck on something sometimes and doesn't move to the exact position.
    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'm still not having any luck. I'm using the same move command event as the grid tutorials. I've added another Change Position node between the Grid Cell Event node and enabling the collider, set up the same way to move to the found object cell, but it's just not doing that, and I'm not sure why. I've also tried disabling and enabling the Character Controller component of the user in the event, just like disabling and enabling the colliders of other combatants in the path, but that's also not working. It's hard to say for sure because it doesn't happen every time, but in my testing, if I manually disable the Character Controller, this problem no longer happens. I feel like it has to be the core of the issue, because it's only the unit that has the Character Controller that does this, but I'm at a real loss on why I can't disable it in the move event.
  • Since you're working in 2D, you should use a custom 2D player control - ORK's built-in controls and the Character Controller are for 3D games, but that shouldn't really cause this issue.

    Try adding a Wait node (e.g. 0-0.1 seconds) before enabling the components again.
    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!
  • For now I've been "cheating" by still having everything in 3D- all of the sprites are attached to cubes, stuff like that. There's a lot more information for 3D out there, and until I'm comfortable enough to write my own custom control, I'm sticking to what I know.

    The wait node seems to be working so far, thank you. I noticed that the movement also pauses for that .1 seconds now, then moves the last little bit to the center of the cell. In the Change Position node, I have it set to wait until movement is done before moving to the next step, so I'm not sure why the combatant is still in motion a couple nodes down the line.
  • I added a wait node to the movement loop, right after the Change Position node, and every combatant's position is stopping .2-.3 short of the center of each cell in whatever direction they're moving along the grid path. I added a debug line at the very end of the move event to print the combatant's position to the console, and they're all .2-.3 off from center at that point, but do move to the correct position. But apparently that movement happens after the move event ends...?
  • Hm ... might that be the combatant radius?
    Try enabling No Combatant Radius in the movement settings of the Change Position node.
    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!
  • It's already enabled, so that shouldn't be it.

    It's starting to feel like I just need a custom 2D control, but I'm not sure the best way to go about that. I see the how to guide on adding one to ORK, but that doesn't tell me what the script should actually look like and what it needs to include.
  • I'm pretty sure there are tons of tutorials/scripts available in the Unity forums/wikis or some of their own tutorial assets, or on other Unity related sites :)
    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 guess what I was asking was more how to make it play nice with ORK, if there was anything special I needed to set up for grid movement and the like, but after just tossing one on, looks like ORK does step in to handle it.

    Thanks for all of your help. So far, so good, so I think this may have solved it.
  • Usually ORK just needs to know which components and where to find them. ORK simply enables/disables the components when the control is unblocked/blocked.

    In case you need anything done when this happens, you can do that in the OnEnable and OnDisable functions of your 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!
Sign In or Register to comment.