Script to send message according to the position and the game and 2d and a character from the side, and also have the mouse cursor, I put a Track to the armature so that it always stay in front of the cursor, but I have a property of type integer where I need to change from 0 to 1 according to the position, for example mouse cursor to the left of pesonagem, property = 0, the right stroke of the character, property = 1, anyone know a script to send message or move directly to the property in accordance with the position of the cursor?
I lost you after 1 1/2 lines reading.
Would you please rephrase your question in multiple simple sentences.
Otherwise you might not find anyone how is willing to read that completly. And you will not get an helpfull answer.
1 - cursor = 0 : pointer over the character.
2 - cursor < 0 : cursor left character.
3 - cursor > 0 : cursor to the right of the character.
cursor < 0 : Direction Property to be = 0
cursor > 0 : Direction Property to be = 1
ok I think I get the idea.
You friend is the mouse over sensor. It tells you when the mouse is over an object (except the view is blocked)
But it is a 3D world, left and right has a large range. It seems to me you might need some other thing. What do you want to achive with this information?
I ask because to get the information you requested, you need a special scene setup or Python. Both might not be the best solution for you.
Below is an example, the game will be 2D, sphere = character and desire that when the cursor is on the left (negative cursor) the property “direction” switch to 0, and the right cursor (cursor positive) the property “direction” change to the value 1.
exempleformonster.blend (202 KB)
example 2, w = jump, a = move left, move right = d, mouse = 2d mouse cursor.
but if the character I very much to the right or left, the cursor reaches its limit. Putting the cursor threshold equal to the limit of the camera?
necessary that the mouse cursor is always limited to camera
exempleformonster2.blend (225 KB)