Blender 2.72 Mouse actuator

Alright so in the new blender 2.72 they have finnaly realised that a game needs mosue look, thanks…

But, is there a problem with it or am i doing something wrong??

With the Mouselook.py script that everyone has always used then the object that is a parent to the object with the .py file follows the camera on the Z axis, and keeps the same rotation. just like in any pc game.

But with this actuator the body/ the parent object doesnt rotate with it… so only the camera is turning around… not the body.

Is this a problem or have i missed something??

ty in advance! :smiley:

well i found a solution, and that is to put X axis rotation only on the head. and put Z axis only on the body.

Stil this is something that feels very awkward to do.

Just bumping this thread since I’d also like to know why. :slight_smile:

You need to have two actuators. The “mouselook” actuator only moves the object that it’s on and its children. If you want to move other objects, you need to have actuators activated on them, too.

That’s how the script always worked. The objects that the LeftRight and UpDown actuators were on were the objects that moved. And with these new actuators, yes, you have to specify X, Y, or Z rotation. That’s just the way it is.

And it’s a heck of a lot easier to use than the script, having to copy-paste from file all the time. This is built right in! =P

Do note that you can:

  1. Put a Mouse - Movement sensor on the parent object,
  2. Then add Mouse - Look actuator on both parent and child object.
  3. Select both and attach both actuators to the same Mouse - Movement sensor.

This way you don’t need two seperate sensors.

This is exactly right

This may seem awkward, but reflects reality.
In a real body the head (here, the camera) is able to rotate independently from the body itself.
Thinking that the camera and the body should rotate together around Z axis is mainly a FPS assumption.

Hello. Sorry to hijack the thread, but I’m having huge issues on the same topic. I’m doing a project for a course, and the new Mouselook is really driving me crazy. For the love of God I cannot find (or there isn’t!) a single tutorial for FPS using the new mouselook script, so I’m feeling like a 10 year old lost in the Amazon forest :’( Is it possible for someone to help me? Should a make a new topic, or this fits exactly into this one?

So the thing is, I’m doing an FPS. I need a camera and a box (which will represent the character that a colleague of mine is doing). I parent the box to a camera, and then I added Mouselook and WSAD movement to the camera. It seems to work great, but when I press ‘P’, I can move through walls! I wanted to use the shape of the cube as the limits where I can move, but Blender seems to only care about the physics model of the parent (the camera). I could add a capsule as a Collision Bound, but that would defeat the purpose of using the box (and later the character model) as delimiter (also, using a Collision Bound, the camera is always located on the middle of the capsule or whatever model I use, which is not what we want. In a FPS, the camera should be in the head).

I’m really just doing trial-and-error at this point, I could really use a hint on how to start with this like it should.

Many thanks in advance for someone who can help us getting out of our hole.

Best regards.

Use dynamic, character, or rigid bodies,

Or cast rays the direction of travel,

On the previous tutorials using the python mouse look script, all the logic is created in an object which serves as the limit boundary (which usually is the character model). The camera is just a child of this object, and usually has no logic associated.

With the new Mouselook actuator, the camera needs to be the parent and has to have the logic. This creates several issues, as we need to create the physics on the camera object (and not on the character). Using dynamic, character or rigid bodies implies loss of flexibility, as one cannot fine-tune the size or position of the physics model.

Out next step will be to revert to using the “old” mouse look python script, we only have a few days left to the deadline.

Thank you all and best regards.

Hello iriki, this is the simplest setup I could came up with:

simplefpssetup.blend.zip [66kb]

there’s a box that represents the body and a camera that represents the head. The head is a child of the body. The body is a dynamic physics object, it all works by using bricks.
It has one issue: it doesn’t strafe and moves at the same time. I don’t know if there is a simple way to combine the two things, I don’t use bricks that much.

The new mouse actuator feels very chunky to me.

Master control mouse, is just about ready to use,
It’s in my discussion about remote control and receiver,
I have a resident evil style mouse control(blue actor)
And a fps control, (red actor).

It uses a set of filters in python to move,
I could connect the filters to motion bricks to
Make it more comfortable to newbs.

Thank you very much, it really works… except the issue you mention:

That issue happens because the cube had the controls assigned as “Linear Velocity”. I applied the movement in terms of Loc: X, removed the values from the linear velocity and voila, it works now!! Many thanks :slight_smile:

EDIT
Great, now we have another bug. Should I make a new thread?

The issue is with these walls: http://youtu.be/5LrVRAo8Lq8
Our model has two walls, and I can seem to “jump” between them. I’m feeling like crap, this feels like doing a major document for school in MS Word on Windows 3.1 and everything is crashing :frowning: Sorry about it. And thank you very much.

You should really use “Linear Velocity”, because that’s the value the physics engine uses to compute collisions. The Loc values bypasses the physics check and just warps the object at some position. When the engine finds that its controlled object has stepped into the bounding volume of some other object, it bumps it out of the collision boundaries.
I know a way to use bricks and correctly mix strafe and walk but it is a bit more convoluted than the straight approach in the test file. I don’t now if there is a simpler way because I go straight for python controllers. I can upload it if you need it.
It is absolutely normal to stumble a lot the first time you use a piece of software, you haven’t really triggered any bug (yet :D).

On the “I can upload it if you need it” I tried, I don’t really have the patience to deal with logic bricks. Here’s the same test but with a python controller to handle linear motion.

simplefpssetup-py.blend.zip [66kb]

the script is really small and I believe self explaining. This works as intented.

Keypress invert is what your missing PGI,

Keypress w invert--------and---------strafe left
Keypress a------------------/

Keypress w ----------and---------rotate left
Keypress a----------/

What I’m missing is J.a.r.v.i.s., the computer ai from Iron Man. You know, like “Jarvis, do this, don’t ask me how, just do it”. That would be an improvement in human computer interaction.

Yeah, but the day it is smart enough to,do what you want, it will probably chop you into compost and plant a tree in you.

I think having a chip integrated in your brain that allows you to code in your subconscious would be better :slight_smile:

Thank you so much for your effort, we can now start from here as this ir working great. Thanks again.