Announcement

Collapse
No announcement yet.

Kismet and an orbiting Camera

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

    Kismet and an orbiting Camera

    Hey gang,

    So I've looked through a ton of threads and tutorials, and haven't quite found what I'm looking for, so my only recourse is to ask for help. Thank you in advance for your time.

    Ok, so, I'm making an iOS game where I want a stationary game board at the origin, and the ability to orbit all around it by dragging on the iDevice of choice. So, I want to manipulate both Yaw, and Pitch. I've been trying to do this in Kismet, but haven't had much luck. It seems like the camera Look At node doesn't do what I expect, and the Attach to Actor/Camera Target trick gives me Yaw, but no Pitch. Should I even be trying this in Kismet??

    Also, when I test the game, after the "player" spawns, I see the camera POV drifting and moving a bit, as if there were a character in the level. What's the best way to get rid of the ambient motion?

    Thanks everyone!

    #2
    The sort of swaying is due to the default gametype, since it's like the castle game where you walk around it's got a setup for automatic swaying as if it's from a person's perspective.


    It is entirely possible to do an orbit camera with Kismet--I'll have to post the info tomorrow, but basically the idea is that you create a new camera object in your scene, then there is an equation to figure out the position of a camera based on angles and distance from the origin. Then there's a way to check touch movement on the screen to change the angle of the camera.

    Comment


      #3
      Hi darthviper,

      Thanks for the info...and I guess that brings up a good question...what's the best default game type for a character-less iOS game? MobileMenu maybe?

      Thanks!

      Comment


        #4
        Using the orbit setup I use, there's no issue with the camera--it uses a Matinee to view the new camera you create, so whatever camera settings were set in that game type don't apply to that camera.

        Although I think there are some game types that have the on-screen joystick, I can't remember what game type I was using. This was at work so I can't check at the moment.

        Comment


          #5
          Ah cool. Well I am looking forward to seeing your setup. Thanks!

          Comment


            #6
            The last time Yaw and Pitch both worked with that Kismet set up was February build.

            I can't get it to work any other way with out coding, so I'm stuck with February. yay!

            Comment


              #7
              Hey Kuda,

              That's a bummer to hear. I've been trying everything I know how, and can't get it work, so I'm glad to read your post.

              Now though, I guess my question is, what does the code look like to get this to work? Are there any examples anyone would be willing to share??

              Thanks!

              Comment


                #8
                I forgot to get my kismet setup, I'll try to get it tomorrow.

                Normally, all you'd have to do is make a new camera, then attach it to the player, then as you rotate the player it would rotate the camera, but that only rotates side to side.

                The method I use has a math equation that will specifically set the position and rotation of the camera based on how you touch the screen. Just like you'd want it to. There's no limitation in it since it's just using math.

                Comment


                  #9
                  Hey darth,

                  Thanks a ton. I can't wait to see how you set it up.

                  --Kev

                  Comment


                    #10
                    First, download this:
                    http://www.megaupload.com/?d=KPZB3GYM

                    I would have attached to the forum, but the text is too long

                    It includes the kismet as text, you can just copy the text and paste it directly into Kismet and it'll create everything automatically. You just need to plug in your camera where it's supposed to go (the matinee sequence, and then for each place that it sets the camera position).

                    Also included is some uscript that adds some new math kismet nodes for trigonometry. It's necessary for the equation to work.

                    place them in this folder:
                    C:\UDK\UDK-2011-11\Development\Src\Engine\Classes

                    Or for whatever version of UDK you are using and whatever folder you installed it in.

                    Here's the Kismet:

                    Click image for larger version

Name:	orbit_camera.jpg
Views:	1
Size:	95.3 KB
ID:	3248737

                    This uses 3 values to set the camera position--a distance from the origin, and an angle for yaw and pitch. The basic process is that it gets your finger position and then converts that into a rotation value, then adjust the value as you move your finger.

                    What's also in there is a distance value--if you wanted to create a pinch to zoom feature you would modify that value.

                    And if you don't want to rotate about the origin but some other position, you just need to update the final x/y/z values, so you if you wanted it at 1,1,1 you would just add those to the final value in the Kismet sequence.

                    Comment


                      #11
                      Hey darth,

                      This is great. I can't wait to get home from work and give this a try. Super cool!

                      Thanks!
                      --Kev

                      Comment


                        #12
                        Kismet image got resized, here's the full size:



                        Also--I missed it, but there needs to be a wire going from "Level Loaded" to the first "Set Vector Components" This is to set the initial position of the camera, this is necessary otherwise if your camera is not in the right position it'll be in the wrong position initially and then when you touch the screen it'll jump to the right position.

                        Comment


                          #13
                          Hey darth,

                          So, I put the uc files in the proper directory, and then copy/pasted the txt file, but I only get a few nodes in Kismet. I get the Matinee, Raw Input, Set Vector Components, and Set Actor Location nodes. I also tried recompiling my scripts, but it didn't work. I am guessing I need to inform my game about the new math classes, but can't quite figure out where the issue is. But maybe I can recreate the graph from scratch.

                          If you have any ideas, just let me know.

                          Thanks!
                          --Kev

                          Comment


                            #14
                            Check your Kismet and see if there's a new Math section under Actions--you need those nodes, there's no other way to do it since it needs Sin/Cos/Tan for the equation.

                            The scripts need to be recompiled for the Kismet to work

                            Comment


                              #15
                              So, I don't have the new Actions>Math nodes at all. I just have the standard list. I opened up the Frontend and recompiled all the scripts. It came back successful, but still no new math nodes in Kismet. I must be missing something. Hmmmmm....

                              Comment

                              Working...
                              X