Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
rotation with mouse
Author Text

Thomas
Guest
Quote
2022-06-06 16:39:37

Is it possible to make a sphere move towards the direction of the muose as if the ball were flying like an airplane? the opposite direction in order to control its directions with the mouse


veganpete
Registered User
Quote
2022-06-06 22:27:15

Yes, you can do it with or without coding - with coding would be easier.

It's a bit difficult for me to explain how I do it......

The way I do it without coding (you'd need the "move AI towards node" plugin) is to use a 1st person camera, then make your sphere shoot towards the camera target, every 70ms. Then (using the same "do every 70ms"), move a billboard to the last bullet position and finally move the sphere's AI towards the billboard.

What will happen is, the sphere will continually shoot wherever the mouse is looking. Then a bill board will move to where the last bullet landed, then the Sphere will continually walk towards the billboard.

If it's too complicated and no-one else give you some coding, I can upload a ccb for you - but first, please take a look at the "Predator Missile Test" project I just uploaded - as it already has it in the demo for you to see there - if it suits what you want, I can make a new one for you to use - but I'm sure someone has the code already that they can share.


Aiming_bullets
Guest
Quote
2022-06-07 09:03:30

there are plugins by just_in_case for this on his website.

[url]https://neophyte.cf/ccb_action_rotate_with_mouse.html[url]

hope this will help you.


nigec
Registered User
Quote
2022-06-07 09:33:30

Thanks for the link... I was going to ask the same question lol

edit.. oh the action doesn't do what I hoped


just_in_case
Moderator
Quote
2022-06-07 14:21:15

@nigec What exactly do you want to achieve?, The above extension allows you to rotate an object with the mouse. The helix Jump Game Demo on my website uses the same extension to rotate the helix with the mouse.


veganpete
Registered User
Quote
2022-06-07 19:09:12

I think Thomas is asking for a plugin that will move a 3D node to the 2D mouse-position - ie, move the sphere to wherever the mouse cursor is positioned... with additional option for "inverted y-axis" on the mouse movement, so up=down. An aeroplane/flight-stick controller. I uploaded one here just a few days ago - but it's not a plugin, just a ccb file with a world-war 2 aeroplane whic can be flown in any direction by mouse movement. The y-axis was not inverted though.


just_in_case
Moderator
Quote
2022-06-08 14:33:56

There is already an extension to move an object with a mouse available actually there are 2 that allows to drag and drop 3D object with the mouse. Also, I don't know if he wanted to have a rotation control with a mouse, but I just updated my rotation control extension. one can use that to create a Flight stick controller as well. as it allows to rotate in any direction. you need to make sure where the object pivot is, For the joystick of the flight stick, the pivot should be at the bottom of the stick. you can then with the help of rotating with mouse action can move it forward backward or sideways.

hope that extensions help a bit.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internationa?" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact