I’m trying to get a character, ( a bird) to turn its head toward the location of the camera in VR. I was able to turn the entire body towards the camera, and have attempted to do the same with just the head. I created a blendspace, blending the turn from right to left, and hooking the variable of it to the rotated information. But it clips, and the animation is not a smooth transition. Any help would be great.
R Interp can’t blend it snapps to target, The lookat and the birds Rotate is off axis and its cant blend, if you split the pins on both lookat and birds rotation and create two Make Rotator and just wire the Yaw to each its own and use those as Current and Target is it works ok but I find its clitchy still not 100%
Best approach is to not use R Interp for the look at approach and set yaw via our selves.
It requires adding 2 Arrows to the Bird and very little scripting and we calculate yaw smooth as silk, and we wont break no necks no poltergeist here
Here is and example of the technique controlling the skeleton mesh bones manually in a regular BP but the technique is the same
No R Interp
When tracking its smooth but snappy when the new angle is great
R Interp
When tracking its smoothish glitchy but snappy when the new angle is great glitchy Current is fluxing from animation
Another thing about R Interp is that its great for controlling the player from the camera rotator but not good for controlling the player form the player rotator so if you change your self your Current becomes non Constant
R Interp No Animation
Works the best R Interp does great no anim so Current is constant over and over but like the two above approaches DeltaTime has to be accelerate x10 to so if the angle is great its turns so fast it looks like snappy in certain cases
No R Interp Look at V Interp Point Control System
The way to go for sure blends flawless with fluxing from animation
Along with the 2 Arrows “LookAtPoint” and “LookAtPointReturn” you have to change you Tick to this
I reference Player location but like you had done you can change to camera location if needed
So if its constraint or distance is too great it wont look at a target.
Thought I had it. Two follow up questions, still having a bit of trouble: is the delta time of the vinterp connected to the delta seconds of the event tick or to the yaw?
And how are the arrows attached to the bird, direction-wise, are they both facing away from the bird or do they need to be the opposite of one another?
I feel like I messed up somewhere in the first part, as it won’t work for me even without the second part connected. Or it has something to do with the arrow.
Ok, so switched out current location with get actor location with the target set as self, set lookat point as target and the location of bird as start. The bird permanently looks away from me. perhaps my blendspace is also wrong? It’s just a simple regular blendspace, I set the yaw variable between -180 and 180. Also no debug lines are showing. If i bypass the first branch and connect straight to the top one i get debug lines, but the bird still doesn’t turn.
Lets get the first part working, Yaw for Blendspace should be -90 to 90 that’s 180 degrees. But Look At Rotation yaw will never give you this Omi Directional place 4 birds facing away from each other yaw will come back different for all 4 this is not what you need, but the base of Look At will the Look At Vector will dot with Forward Vector from -1 to 1 and with * 90 you get -90 to 90
So set Anim Yaw from this and the bird will look at the placed look at point, send me a screenshot of the current not working step 2
The first part look at rotation and combine replace that with the look at vector image I sent. The current setup seems only for a object rotated -90 facing the Y axis
Ok. so, with this, the bird is turning its head toward the camera, and debug lines are drawing, but only when I look to the left of him. So its head is only turning in one direction, then goes back to center.
Have you set Blendspace to -90 to 90?
And move the look at point to the direction that it wont turn break the wire to step 2 till we get this part working.
Part 1 is the part that looks at the lookatpoint, you mentioned it turning left but not right you can test this with moving the look at point to the right or left in the BP and it should look at the point with part2 disabled.
You can print out the yaw when directly in front of bird read 0 and to the birds left 90 and right -90
You can verify the Blend space by hard coding Yaw in step 1, -90 0 90 this will test the blendspace without our math.
Hardcoding the yaw works both 90, 0, and -90. If I do a print string from the yaw with only the first part connected, I get zeros, it doesn’t change. If the second part is connected, I will get values, but they stay bewttn 30-40, and don’t go negative.