Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
How to make Rotation of node on Mouse Move? For example: If you move mouse left, your node (player) rotate to left too. I need to make rotate player to left/right via mouse and just look camera to up and down (using third person camera) (Cause turn player via keyboard actually don't easy in action games) |
||||
|
Its difficult to do it with the present functions, hope NIKO has some solution for it......... |
||||
|
I think its pretty easy... All you have to do is script a beahviour... Which changes rotation of the player by +1or +10 or any value you want... When mouse is moved in the negative x axis.... And same is for rotating the player clockwise... Just change the rotation to -1 or -10 or any value you want .. when mouse is moved in the poisitve x axis... That have to be scripted as per on frame event...its a little bit same as drawing custom... Mouse... But in this.. we dont draw custom... Mouse and change its position according to the real mouse... This time we rotate the player node with the real mouse cursor.. Hope you understand this.. Or if you want maybe i can try to make this behaviour for you.. |
||||
|
I'm not a programmer :( Also i would be very grateful to you if you can help me |
||||
|
Try the behavior, every few seconds eg, 200 milliseconds then add the action, rotated to fixed position, it should work for the animated character behind the arms... But it might come with a high performance cost |
||||
|
Woops , it is called "set absolute rotation" |
||||
|
Nope, i work with CCB since 2013, i make more games with that engine and i know what features CAN'T MAKE WITH STANDART BEHAVIORS. But i know, it can be possible with JS,so... i don't know JS... |
||||
|
@zoo he is asking to rotate the player model relatively with mouse movement...... Which is not possible with inbuilt standard behaviours.... For that you have to script another behaviour... |
||||
|
Sorry can't help, I don't know much maths, I am a coder...but cannot work in 3D, only 2D Maths |
||||
|
There is one way if you are doing this with webgl, first, use vanillaJS, use var x = x_capture_mouse_pos(); var y = y_capture_mouse_pos(); then, the variables will tell you the x and y pos, all you need is to implement this to the game. for ex, the player will point to x on the screen, and y on the screen. Hope I could be able to make you understand. |
|