Orbiting Camera

I’m sorry if I asked this before ( I may have done ) but I’ve gotten a sort of working basic third person camera but I want the camera to rotate around the attached object, now the problem I have is I have the mouse look script working on it but every time I move the camera the object thinks that it needs to move with the camera.

Now I read all sorts of solutions but a number of them looked quite outdated and then there was this idea that you make the camera a child or something, but the basic idea is that I want it to work like this.

As you can see the character is being moved with the arrow keys and at the same time, now I know this must have something to do with the way that I’ve parented the camera to the player but I’m just not sure how to fix it. I’ve just done a standard ‘to object’ parent.

Instead of putting the LeftRight actuator on the object, put it on an empty that is located at the object’s center. Set the camera’s parent to the empty instead of the object. Finally, set the object as a vertex parent of the empty. There you go, your camera will spin around the object without matching the object’s turn as well.

That’s helpful for using the keyboard but I’m talking about orbiting purely with the mouse then that way it feels a bit more natural when you’re moving about with the WASD keys, would this work with the mouselook script?

Will give it a try and see regardless :smiley:

Edit: IT DOES WORK! HOLY SH*T THANKS! :stuck_out_tongue: this one was annoying me for awhile! lol :smiley:

It should, if you’re using the mouselook script that isn’t combined with the movement stuff.
Also, 2.72 has built-in mouselook actuators. Look into those if you want a more… simple way of doing it. :stuck_out_tongue:

Yeah, I’ll be experimenting more with this, but now I have pretty much got access to all the camera angles I need to make games so that’s one major thing out of the way.

Okay, I nearly have everything I want now, there’s only one little thing left and that’s the way the mouselook script itself works the X axis it seems that they’ve put it on rotate because it was designed for an first person camera but I want to change this so it goes to transformation. Could someone who knows the code better than me point me at the bits that I need to edit? I was digging around a copy I made and found Xmove, Ymove but those don’t look right for simply changing what type of movement the script makes.

Can you post the script? I’m at work and I don’t remember where to go to get it online. I know the script pretty well, but I need to see it to change it.

It’s too big for me to post, but I can give you a link.

http://riyuzakisan.weebly.com/mousemove-script.html#toc

And LOL I just realised there’s a whole bunch of documentation on the code >_<

Ohhhhh. Yeah, this is the script that I don’t use. It’s too… constricted and controlled for me. I use the tutorialsforblender3d.com script, which is a lot more malleable and useful for way more things.

So, why exactly do you want to move the camera? What’s your overall goal? Because there might be an easier way to do it than editing the script. :stuck_out_tongue:

It’s because with 3D platformers if you have a horribly restricted camera then it’s very difficult to jump over things when you need to be precise about it and stuff, so better to give people the full 360 degrees to move around to the angle they want rather than have that awkwardness where the camera gets too close in and so on for you to see.

Ohhhh!
I’ve done a system a lot like this myself. I’ve got a few demos sitting in my HDD at home that I can pass on to you, but it wouldn’t be for a few hours…

I’ll poke around and see what I can find in the mean time, there’s no rush, I’m slowly getting through all these major game mechanics and then after this it will be all down to my art skills :smiley:

Check out my resource? https://www.youtube.com/watch?v=1ZIVjnat9mk

it’s python is in two pieces - Mouse set property (ForceLean.py)

moveWith - move with a object -

this is then offset using X Y and Z,

I already know how to have that set up, what I’m looking for is different, I have it about half set up correctly now but the Z axis causing me a problem since the mouselook script was designed for first person. I’ve at least gotten a nice zoom in and out camera my keys now which is pleasant, just got to solve this last issue.

Sorry, Z axis not bloody X axis, basically just moving the camera vertically is a problem right now :stuck_out_tongue:

OHHH
Okay. NOW NOW NOW I get it.

There are two ways you can do it. The simplest is to put both the LeftRight and UpDown actuators on that empty.
The more complicated, I can describe if you want me to. Try out the first way first.

Hang on, you’re going to have to point me towards LeftRight/UpDown actuators because I haven’t seen them yet.

Bumping this guys because I want to fix the way moving my camera vertically works, once I do that I’ll have the effect I want.