How to fix problem with mouse controller (Y axis invert when look at the negative coordinate) ?


Here I made a video about my static mesh than I can edit and play with :

I’ve follow some tutorials and mix them all to creat my own Blueprints :slight_smile:

I need a Mesh fully editable and the possibility to put component (like the Hover component I drop).

So now I can go forward, back, strafe left and right, turn left right up and down, but ! When I put my mouse to up it’s ok my mesh go up. Then if I turn and be front of the negative axis my controller invert the Y and I have to put my mouse down to go up and up to go dwn… I try to put a “get world location” to it but I’m too newbie for that -_- How can I fix that please?

Then, if I fix that I will get my fully editable static mesh controller and it will be so great :smiley:

Thanks a lot

Here a screenshot (find it in the video too)

After 3 days I find nothing. I try lot of things but nothing work.
Please tell me how I can tell the Y axis to follow the movements of my mesh like I did for the forward and up movements.
Sorry for the up but I really need help.

Video of you scrolling over blueprints does not help. Better post pictures. There is something somewhere messed up (you know that already).
I see you used supergrid from marketplace, so i think you cannot share this project freely.
But if you do not have any paid assets in it you could zip that and share for day or two on dropbox. Then i could help.

Or try to describe what is exactly your problem (cannot spot it in the movie). Make pictures of your blueprints.

Or describe exactly how that box actor should behave, i probably could do such blueprint fast.

Because i cannot see clearly your blueprints in that movie and i am unsure what is problem, i describe how i would make 3d movement.

  • first do that movement in world location and world rotation reference frame.
  • create blueprint that is your cube. put cube mesh on scene root

for every axis movement do this:
get axis value from controller. Multiply it by vector for X [1,0,0] for Y [0,1,0] for Z [0,0,1], get actor location (that is cube actor), add those vectors from x,y,z , set ACTOR LOCATION
you should have nice x,y,z movement.

for rotations (per single rotation axis)
get actor world rotation, break it into yaw, roll , pitch, add input axis value to one of yaw, roll, pitch. make rotator again with 2 values copied over and 3rd that has added input axis, last is set actor world rotation.

Ps. but you are adding torques, how are you moving your mesh? it is physics mesh? I am kind of lost in what you did there.
I watched this video, and either you want to make some complicated physics based stuff, or you overdo it.

yes I got Supergrid but I don’t use it in that project :wink:
I use this cube with physics yes ! And I don’t want to use the base character controler because I can’t feel like flying and hovering.
I need this gameplay cause the cube will be change for a Mech :smiley:
I can send you my project if I find how to export it.

Thanks a lot for the answer !

I try to explain here what is the problem while my project is uploading in mediafire.

I got my main Character that can be play. You can control it like all playable character.
When you press a key, it replace the character by this cube.
This cube work like a vehicle that you take the control.
So I need a different gameplay with this cube than the Character.

I want it to be control like a Mech in an anime serie !

I put force that can be editable with variable for : going forward and back (it feel like using reactor), going up and down (like jet pack), you can strafe like you put the reactor force on a side and with your mouse you can look right and left.
The problem is when I use the mouse Y axis for looking up and down…
I think I have to tell in the blue print : “hey, my cube moved ! so take the new coordinates and see that the Y axis changed !”
But I did some tutorials and think a lot about it and I can’t find the good thing for that.

I think you’re right when you told me : “for rotations (per single rotation axis)
get actor world rotation, break it into yaw, roll , pitch, add input axis value to one of yaw, roll, pitch. make rotator again with 2 values copied over and 3rd that has added input axis, last is set actor world rotation.”

But I don’t know how… When I try it put me some items with blueprint that I can’t log into the good things. That’s make me Crazy !O/*%$ O_O !?& !

I don’t know why I did it for the Z (look right and left) and it don’t work for Y (look up and down)

Here you can see the blueprint for the forward movement :
I add Force to the cube (call mesh mech in the component panel)
Then you can see the variable : Reactor Power
With this variable I can edit the Reactor Power. So you can go faster or lower when you go forward and back.

Here the one for Strafe :
I add force to get the movement to the side, like you dodge.

Here the one for up and down (jetpack-like) :
I just add force to the up vector from the cube, then you can go up and down but you can aim down and going forward like if you control an helicopter

Here the one to turn right and left with the mouse movement :
The TurnRate variable is use to change the speed when you turn. Like you use an joystick (hotas)

And finaly, the look up that make me crazy !!! :
I can’t find the way to tell to my cube that the Y axis change. So it making my cube rolling in all the directions. It’s logic but I don’t know how to fix that.
When I start the preview, my camera look in the origin of the axis X,Y,Z. So If I look to the positive coordinate it’s ok. My cube look up and down when my mouse go up and down.
But, if I turn and look forward to the negative coordinates, my mouse invert the control… And when I look on the Y axis or side it makes me rolling…

You need to test some things with movement, i think i am starting to get what you want fixed.

Create KEYBOARD controls for all moves and rotations.
For eg:
A D for left right,
W S for forward/back
R F for up/down

UJ for rotating X axis
IK for rotating Y axis
OL for rotating X axis.

For eg A should have +1 whine D has -1 value. Add those keys and values in same place you added mouse axis values in project settings.
This all is to test if that is due to your mouse or your code. With keys you can test separate moves and rotations and be sure you trigger only one.
If with pressing only keyboard you will have same problems then culprit is torque.

In that case you can either calculate torque vectors properly (which needs some testing) or use physics thrusters instead of torque and add force.

Ps. I am guessing now but i think torque is added relative to rotation of your mech box. So as long as it is horizontal it will rotate left and right, but when you rotate that box so left and right is also rotating. It is same if you were this box and somebody would rotate you upside down, your left and right would be switched to somebody looking at you from distance. So if that person told you to rotate left, you would rotate to YOUR left but for observer it would be like you rotating right.

Edit: i think that even with physics thrusters you need to calculate vectors.

I already get my input here

I’m ok with you and I’m sure that my problem is to told in my blueprint that to take the Y axis of my cube.
As I say, it’s just I don’t know how xD

(If we can talk quickly on skype it could be nice ^^ I sent you my nickname)

here my problem in picture xD

The cool thing is that the X and Z axis follow the cube !

Unlike the Y axis that never change :frowning:

My upload is complete !

I hope to fix that problem and I will uplaod the final version to share to every one a flying editable static mesh :smiley:

And the video is uploaded too :

Sorry to reply again but I take time again trying to find a way and I think about something like that :

But I don’t know what I have to put where I make the “Red ?” :’(

I think It’s almost there !

Well it may be not that easy, adding rotations may be tricky. For eg take some item rotate it left 90 degrees, then forward 90 degrees. Remember its final position. Now do same but first rotate 90degrees, then left 90degrees. It will be differently rotated. That may be reason of your problems.

Second reason may be that you rotate that box in local coordinates. It is almost same as above problem.

I almost have this project downloaded. eta 3min

Ho man you’re so helpfull ! You can’t know how it’s making me crazy !
I got the gameplay that I want just here and I have that Y axis to fix… I was thinking about leaving this mouse movement and doing only a right and left movements but…
It’s not really fun to play like that. And you can’t aiming nicely :frowning:

Ho ! I forget to tell you.

I check the box for constrain rotation for the mech mesh for the X axis. It makes the mesh return to the right axis when I hurt a wall or something.
I always try to uncheck that box to see if it’s a problem or not but at the moment it’s not helping me :frowning:

I know what is going on, you have more problems with this project than just rotation. After colliding your mesh starts spinning. Also is nothing wrong with look up there. I am trying to find solution for this.

Btw do you want mech movement with jetpack for game?

If so you should start looking into third person template, and character movement component. It is better for mech than your hoovering approach.

My fast solution to this separating movement from rotations. But as i said you probably want character and animated mesh.

When the mesh is rolling it’s normal and if you wait or use the good input you can stabilise it quickly. I want this rolling on collision. It’s like a car crash. I want in the gameplay that the player will have to dodge enemy and all the things like building etc…
The movement I got in now is all that I want.

But I can make you a list :

  • I want a hoverfeeling. When you are close to the ground I want that the mech hovering not land. The mech skin will not have feet. Like the mech in Zone of the Enders

  • I need physic on the mech with not only a directionals movement but with force. Like in a spacecraft with thruster.

  • I have to make the mech loosing control when hiting wall or something and the player could use reactor or thrusters to stabilise or just wait a sec to return to the good axis. Like a crash as I said.

  • and finaly, I want that mech can use aiming. I will put a cursor as child of the main mesh.

But I’m agree it will be cool to use character control but when I do that I can’t apply force like with thruster I get now. At the moment I can only put the hovering component.

I forget to tell that you will be in the cockpit view not in TPS. But it’s just a camera.

Ok after testing i see there is everything fine with rotating.
It is just camera that does weird stuff.
You should also add some auto stabilizing function to this.
Change camera a bit, and you will see that it was camera that made you belive its weird rotation of mech.

camera arm.png

(We really have to talk in skype ^^)

Yes ! Like a spaceship but I want it falling slowly when you don’t use jetpack/thruster/jumpjet.
It’s the reason why I put the hovering component :slight_smile:

And it look so great !

I think about making more power on the hovering to get the player desable to touch ground. I don’t know yet. But when they stop trying to touch the ground they will have a big jump boost and it could be so cool :stuck_out_tongue:

Anyway I have to fix other problems right now.

And yes it could be so cool to get a character controler or a spaceship template. I think it will be easiyer to add static mesh or component for the skin :wink:

I made some stabilizing code yesterday, it works fine. But whole hoover component acts weird, sometimes it gives wrong rotation values, sometimes it is somewhere off in 3d space. Weird stuff.

S0, I had idea for simple solution to what you want:
instead of making hoover component, make hoover blueprint (that uses thrusters) actor. Place 4 of them on corners, this will be great simulation of hoovercraft.
I will play with this a bit more tonight, this is fun physics stuff.

Thank you I got the project.

But it’s not really playable and I lost my physic from the hover component. The gameplay change totaly. I don’t have the falling physic (linear damping) and the natural force for angular damping…
Feel like playing a game on PSX lol.

I have to find another way. I don’t know how but I have to find something.

I think I’m going to block the possibility to control the Y axis with the mouse and only put a target system.

I just have to make a target system now and find a way to make my cub back to the right axis when I hit a wall or ground.

I think about something in the hoverComponent

I just tried to find what is wrong with your project, do not use mine, instead look what i changed. I didn’t care about playability i wanted to find your problem and solve it.
I turned off gravity for the box, it was sometimes falling to ground and doing that random spin after collision. I think i know what you want and when i have some time (after work) i can do hoovering vehicle quite fast. Sadly hoovering component behaves weird, so easier way is to make hoovering blueprint and attach 4 of them to box. I have quite good idea for it, it also can be used to make antigravity ships. So will probably use this idea some day for racing game.

Yes I understand, but the hovercomponent is cool cause I can edit it easaly ^^

I’m looking to find a way to return to the original axis for the cube and it could be cool :stuck_out_tongue:

The cube do not have to look ground or roof cause in the final project it will be a Mech and it will stand up all the time. I don’t really need it to fly like superman xD
(But I’m agree it will be better to fly in all axis we want :frowning: )

I just try to put 4 hovercomponent but it’s the same problem. I don’t get stabilizing ^^