Hello to Everyone… ( ask you sorry for my english in advance )
my problem could be simple for you ( and i hope be )
I use a first person camera… and when i pick up an object it will appear in front on camera to be examined.
NOW…
i use MOUSE_X axis ( from axis mapping - Input ) to controll the “YAW” and MOUSE_Y axis to controll the “PITCH”.
everything works great but…i want my object could turn ( pitch ) always in the direction of camera.
when my object turn on “yaw” the axis turn with it so…the pitch change direction too PIC2
You need to define your own axis as the cross product between the camera vector and world up (0,0,1). Then you need to instead perform a rotation on your axes as vectors around the newly defined axis. You will not be able to do what you want by using a rotator since by definition you are restricted to the 3 main axes of rotation.
Thank you, may i ask you if and where can i find some tutorial or forum about " create this vector axis "
i already can create a foward vector from camera…but i can’t create one vector crossing my camera vector
Sorry Again
i can’t do whatAnswered to me
I’m a beginner… with programming.
Can some one let me see how to do? maybe a blue print screenshot
Thank you so much in advance and sorry again
thank you eanandroid but dosen’t work for me ( same problem ) maybe can help you if i say that …
The blueprint is the PLAYER blueprint and the object i take in front of the camera is an EXTERNAL ACTOR…
i created a variable ( actor ) and i set the actor in accordance with what object I interact.
so… instead of GET WORLD LOCATION i have “GET ACTOR LOCATION”
That is not the rotate note I was talking about. I am talking about “rotate vector around axis”. You need to supply it with a vector AND and axis. And you need to do three of them, one for the fwd vector, one for the left vector, one for the up vector.
The math you have going into your rotator is part of what you need for an axis. You also need to do cross product with (0,0,1) to create an axis that is perpendicular. Then you need to use that as the axis to rotate all 3 vectors and then make rotation from the vector axes.
Hi ,
may i ask you an example of blueprint screenshot of all operation?
I’m stuck from more than 1 month in this problem
i hope to don’t ask to much…
thank you so much
PIATTO is the actor i tested for the Ryan’s Solution
but my intention is to use an EXTERNAL ACTOR so i created a variable ( ACTOR ) called OGGETTO_PRESO ( you can see in the previous pic )
and everytime this variable will be setted by " LINE TRACE BY CHANNEL - BREAK HIT RESULT - HIT ACTOR - "
but with ACTOR variable i can’t use " getworld…POSITION or ROTATION " i can use only " getactor…POSITION or RELATIVEPOSITION "
what can i use of those?
thank you so much… and sorry for bother you again
I don’t want GIVE UP…
You need to debug to see what is going wrong at this point. Your math looks the same so something about your vectors or actor locations is not working as expeted. Do draw debug sphere on all your locations to make sure they are right.
Ok i found the problem…i used a normal " vector*vector " instead " CROSS PRODUCT " ( you can see from the pics i sent before… my have ADD PIN your NOT
Now work perfectly … i’ll check better for be sure.
So…what can i say… thank you so much for your help and time spent. You are so helpful.
Thank you.
oh man I feel your pain… those nodes are way too similar looking. I remember complaining about that a while but but not sure what happened to that bug report… Glad it is working now!