Announcement

Collapse
No announcement yet.

Turn based strategy on a cube! How to properly rotate actor?

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

    #16
    Sorry, make sure to use Normal and not Impact Normal. The Normal from the hitresult is basically the Direction the cube face is facing in. For example if your character was on top of the cube the Normal result would be 0,0,1, if on a side it could be 1,0,0.

    I am at work so I cant go into detail but I know Ramas tool can hepl you. other wise

    https://answers.unrealengine.com/que...acter-wit.html
    My Game Frontier Devblog HERE

    Comment


      #17
      Originally posted by Orkney View Post
      When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


      use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

      Failing that get the Hit Normal of the line trace and use that instead.

      This would not need to be hardcoded and would work on surfaces that were not 90 degree
      I knew it shouldn't be as difficult as I made it to be. Using this method will allow for dynamic levels.
      Checkout Project "TwinBlaster" my current game in progress.
      [FREE] - 2D ROPE! Find out more here!
      Forgive my username... It's an old game name and wrote it down as a habit.

      Comment


        #18
        Originally posted by Orkney View Post
        When you place the character in the correct place above the surface, Fire a LineTrace towards the cube, get the hit location of the hit on the cube surface.


        use FindLookAtRotation from the centre of your character to the location supplied from the Line Trace.

        Failing that get the Hit Normal of the line trace and use that instead.

        This would not need to be hardcoded and would work on surfaces that were not 90 degree

        ok so ive got the look at rotation from the location my character would be to the hit location. its not exactly working...

        Click image for larger version  Name:	Untitled.png Views:	1 Size:	276.0 KB ID:	1468354
        im still not entirely sure what you are wanting me to do withe the normal you mentioned. i tried to figure out how i could use the rotation from the normal but never could get anytthing to work.


        the following is my current blueprint for getting the new rotation. (marker is where the character center location would be.)

        Click image for larger version  Name:	Untitled.png Views:	1 Size:	151.3 KB ID:	1468353


        I might honestly need a "explain it like i'm 5" short course from someone who understands vectors and rotations better than I do. Orkney SkeetonYu
        Last edited by beanswaggle; 04-29-2018, 02:31 AM.

        Comment


          #19
          Let me finish this game onfortnite then ill do a mock up exmaple
          My Game Frontier Devblog HERE

          Comment


            #20
            So I dont know if this will work...

            https://blueprintue.com/render/e4k6ss2e

            The get all actors of class node has the surface actor (the cube) , I would suggest not using that node as it fires every frame, just store a reference as a variable. I put it in the construction script here just for this demo but this function does not need to be set every frame, only when the character is moved.

            heres a video of it
            https://youtu.be/Sn9nLLxV_qg
            My Game Frontier Devblog HERE

            Comment


              #21
              Eureka! https://i.gyazo.com/b5b84c866475d828...6e15d3ac23.gif

              as you can see in the GIF i got it to work! I started messing around with each of the "Make Rot from" nodes just to experiment with what happens.

              The Make Rot from Z like was used in Orkney's link (https://blueprintue.com/render/e4k6ss2e) provided really good results. With it i was able to get my unit's feet to always be on the space no matter which side of the cube it was on. At that point i knew i needed to make a Rot from Z so i started to experiment with "Make Rot from ZX" and "Make Rot from ZY".
              When experimenting with ZX I decided to get the Unit Direction Vector from the location of the character on the old space to the location of the new space. I plugged the normal of the line trace into Z and the unit direction vector into X and got my Rotation. It works perfectly!

              Here is the Blueprint for anyone else that may run into something similar later on.

              Click image for larger version

Name:	GetNewRot.png
Views:	23
Size:	172.7 KB
ID:	1468683

              Thank you Orkney and SkeetonYu for helping me with this!

              Comment


                #22
                Needs more moustache.

                Comment


                  #23
                  Originally posted by Everynone View Post
                  Needs more moustache.
                  oh geez... you remember :O

                  the game has come quite a long ways since you helped me a while back man!

                  Comment


                    #24
                    The idea of a cubical playfield like this really speaks to me. I've been playing Into the Breach recently and it's truly astonishing how much gameplay they managed to squeeze out of a simple 8x8 field.

                    I'd like to see where you're going with this project.

                    Comment


                      #25
                      Originally posted by Everynone View Post
                      The idea of a cubical playfield like this really speaks to me. I've been playing Into the Breach recently and it's truly astonishing how much gameplay they managed to squeeze out of a simple 8x8 field.

                      I'd like to see where you're going with this project.
                      Exactly the same way I feel. Game looks very intriguing.
                      Checkout Project "TwinBlaster" my current game in progress.
                      [FREE] - 2D ROPE! Find out more here!
                      Forgive my username... It's an old game name and wrote it down as a habit.

                      Comment


                        #26
                        Everynone SkeetonYu Currently the goal is that once I get to the point in development where the base gameplay has a solid foundation I am going to start a devblog, social media, and get a little more involved with posting my progress. I just want to get to a point where I feel like the game is presentable before I try to generate a following. Hopefully that will come here in a month or so!
                        I was making quite a bit of progress until I started working on multiplayer. It took me forever to get steam integration and online multiplayer working . I've hit my stride though and am making a lot of progress again. Ill let you guys know when I start posting progress so you guys can get a better look at what i'm making!

                        Also, the fact that you guys are showing support with the smallest glimpse of my game is extremely encouraging. Thank you guys so much! ​​​​​​​

                        Comment

                        Working...
                        X