Announcement

Collapse
No announcement yet.

Top down 3d game - How can I push an object on touch (100 units at a time "grid" on X,Y)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Top down 3d game - How can I push an object on touch (100 units at a time "grid" on X,Y)

    So I have my character as a paper flipbook sprite in a 3d world that doesn't rotate per se, it just swaps between different flipbook's and repositions itself on the x/y/z axis. This was fine in early implementation, but now that I am adding more mechanics to the world it is causing headaches trying to figure out how to push an object away from the characters direction. With no rotational data to go off I am stumped.

    I may well be going about this the completely wrong way so would love to hear any better methods of constructing this!

    To clarify - I am trying to integrate a pushable pillar that moves in the direction it is pushed along (on X,Y) until it has collision with another object/wall (not important for now though, just the movement working correctly would be a great start!). Using physics is too "free" for this particular object, it needs to be a linear movement conforming to a 100 unit grid.

    Here is the character (Paper2D) event viewer tracing collisions and calling the movement/sprite change function
    Click image for larger version

Name:	help0.jpg
Views:	1
Size:	460.9 KB
ID:	1203886

    Here is the movement/sprite change function referenced within the event viewer of the character
    Click image for larger version

Name:	help1.jpg
Views:	1
Size:	563.7 KB
ID:	1203887

    This is the object I am trying to move (bare bones with everything unnecessary stripped out). It currently moves positively up the X axis when pushed from every direction because nothing is telling it to do otherwise at the moment.
    It's clunky and needs smoothing but it's correctly picking up the collision trace at least i suppose.
    Click image for larger version

Name:	help2.jpg
Views:	1
Size:	310.1 KB
ID:	1203888

    Any and all help would be appreciated. Scratching my head on this one but go easy, I am still learning the ropes

    #2
    You can use the getDirectionVector node to identify the vector you need to push the box in (just remember to isolate the X/Y axes) and go from there.
    Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand

    Comment


      #3
      Originally posted by 6ixpool View Post
      You can use the getDirectionVector node to identify the vector you need to push the box in (just remember to isolate the X/Y axes) and go from there.
      Thanks for the response 6ixpool, I tried using this but I couldn't get it setup and working correctly, but I have got it working from a cast of my previous variable for use as an index and a few other tweaks. Silly me

      Comment

      Working...
      X