PhysicsMouse Demo

CTRL = bring up cursor

CTRL + Left click on RED OBJECTS = select object to manipulate

CTRL + Mouse move while targeting = move object using physics

CTRL + wheel up/down while targeting = push in / out using physics

CTRL + Right Click + Movement = rotate targeted object

Edit: fixed some bad math :smiley:

Attachments

PhysicalInteractiveenvironmentSystemV4.blend (741 KB)

1 Like

Could you make the player character grab and pick up a cube that he is near simply by clicking on it?I am just giving you an idea for your next project.

1 view :expressionless:

Peoples , this was hard work,
at least take a look?

This is cool!
Something like this could be the basis for a Trespasser FPS rig!
(the game was crap, but very much ahead of its time in many ways)

Something like that in say, a first-person survival game (…), could have oodles of potential.

Quite good, useful for building games that uses physics, also for strategy:)

Would be cool if you could make it easy to implement games. I´m thinking of maybe just adding a certain object to your player character and done. If that was possible, it would be awesome!!!

Thanks Nines!

@blenderendersky

The object ‘control’ can be dragged and dropped in,

it also has ‘remote control’ to be able to swap actors, and send mouse input etc to vehicles or drones etc,

I suppose I could separate them tonight.

as far as I can tell this should work with any game now,

just append the pies controller object into your blend,

anything you want to manipulate needs to be dynamic or rigid body, and have the property

‘Phys’

I was thinking of adding a range property,

let me know if there is anything preventing you from using it,
I’ll try and shape it to your needs. (community)

https://i.creativecommons.org/l/by/4.0/88x31.png
Wrectified- Pies by Jacob Merrill / Wrectified
is licensed under a Creative Commons Attribution 4.0 International License.

Attachments

PiesExtracted.blend (636 KB)

Thanks for example, BPR, it looks very useful;)

No problem adrain,

Tried it out and it´s really easy to use! Though it´s a little weird when you use it with a first person script, you might have to adjust it for that. Adding in a range property would also be very helpful. Also I think you should remove the need to press ctrl first before you can grab.

I have ctrl disable mouslook so you can use the controls it operates by

you can have it do

body.alignAxisToVect(own[‘Lifting’].worldPosition-body.worldPosition,0,.5)

to point the body at whatever you are lifting

and

head.alignAxisToVect(own[‘Lifting’].worldPosition-head.worldPosition,0,.5)

so this ‘takes over’ mouse control.

This is what happens for me, changed it so you only have to press left mouse button to grab and leave it to release.
The camera is crazy!
https://copy.com/OwZiXtM8Xe2qNIND

yeah, the system that is looking at the cursor needs to be changed to look at the object while grabbing

if type(own[‘Lifting’]) is not str: == if your are lifting something :smiley:

if you Debug own[‘Lifting’] will see it disappear and reappear as you lift / don’t lift

I need to alter your mouselook system,

you need basically

if your not lifting something----------mouselook ON

if your lifting something-----mouselLook Off

I am pretty sure they fixed mouselook actuator in 2.74

maybe I can just use logic to do it stretched from the controller to the mouselook head and body?

So as far as I understand changing to mouselook actuator should make it easier, then why not. Change anything you wish.
Ah ok so I changed it to mouselook actuator and it works. The mouselook still works when lifting an object and the camera doesn´t follow the lifted object, which is exactly what is needed. The grabbed object really drags behind though, and I didn´t find a way to make it suspend quicker after gaining a lot of velocity.
Also, you´re not able to take objects anywhere, because as you move, they don´t follow your movement, but you have to scroll them back and forth. Would be cool to have them follow.

here we go :smiley:

http://theorysend.com/uploads/2e5608981356ed064401268d0de2d79250d6751c

your working file

note -> noticed the mouselook actuator does not gracfully return head to alignment when lifting released

going to have to do

if Lifting is changed----Align Head To Body center
if Lifting = "Empty----/

Ok, I think this fixed all that

http://theorysend.com/view/d4a85902f25bb7b9c6780d2e9f334e0c92469c44

made it so the mouse control does not engage until after the vision is reset from the lift

Edit: Just noticed that you want it to follow the player if he moves,

own[‘Lifting’].worldLinearVelocity = (own[‘Player’].worldLinearVelocity+own[‘Lifting’].worldLinearVelocity)/2

this way as you start moving if picks up the same momentum

edit - still having trouble with moving the object and player but I think I may have a solution,

Ok, just checked both of your files, and both made the camera turn weirdly, so after grabbing something I was turned. Maybe you can make the mechanic like in Amnesia, that the camera doesn´t focus the grabbed object, but the grabbed object just follows the players movement and drags behind a bit, depending on it´s mass. If that´s possible.

sure thing,

its actually pretty easy

I’ll try and get to it tonight,