edited May 2020 in ORK Support
I'm trying to push a box - that works, but I want to make sure that it can't move at an angle that isn't 90, -90, 180, -180 so it doesn't move slanted. I also want to make it so you can hold the interact button down/a directional key to push the box after you grab it - but as you're grabbing it there's a different walking animation playing for the player(one for pushing!)


and while I'm here... what is the best way to achieve pulling an object with the same mechanisms I'm trying to do lol?

My idea right now is a combo key for A and movement axis'. But I don't know how to necessarily set it up where it would work like:

Pushing:
Player moves box to the left. To do this they hold down a/left axis to continuously move object to left until it falls or until the player lets go the keys, ending the event

Pulling:
Player pulls box to the left towards them. To do this they hold down a/RIGHT axis to pull it towards them.

This logic would apply to any direction.

What is the best way to achieve this?
Post edited by PBoTG on
  • Using a Move Into Direction node would ensure that it'll only move into defined directions, e.g. forward (either in local space of the box or in global space north) would be X=0, Y=0, Z=1.
    Continue pushing/pulling could be done by checking the input keys at the end of the event and go back to the start in case they're still pressed.

    Pushing and pulling would basically be the same thing, just playing a different animation on your player :)

    Generally, it might be easier to do this with Makinom, as it has a lot more options for these kind of mechanics.
    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!
  • edited May 2020
    Ok, so my next question.

    Another issue is, if there's an object in my path and I push the box, I have a check distance so they don't completely collide from the front. But then I can't push it to the left anymore because it'll only move if it's not that close to the object in the path.

    I do have it moving in local space, but if it doesn't rotate to the player, it only moves forward. If I'm on the left of the box facing it, and use move direction, the box still moves north (instead of moving to the left, the direction the character's facing). So then I use rotate to player - the problem with rotating to the player is that it can end up being on an angle that isn't straight forward from the player making a puzzle not work. I'm unsure how to fix that?

    I check the distance so it can't collide with the black box. My next decision was to check if the player is to the right of the box, and if so, you can still move it despite the distance because you're not pushing it z forward into the black box, you would be moving it z forward to the gap on the left.



    Except when I check the orientation's success/continue the event as is, it fails.



    I've tried switching around the from object(including just fixing to check and to object to the left but to no avail)
    Post edited by PBoTG on
  • edited May 2020
    You can use a Check Orientation node to check on which side of the box the player is and move it accordingly instead of always moving it forward, so no need to rotate the box at all.

    Player at the back of the box? Move it forward (X=0, Y=0, Z=1).
    Player at the front of the box? Move it backward (X=0, Y=0, Z=-1).
    Player at the right of the box? Move it to the left (X=-1, Y=0, Z=0).
    Player at the left of the box? Move it to the right (X=1, Y=0, Z=0).
    Post edited by gamingislove on
    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.