I also implemented the same thing to the third person sample project which you said was what you were using, to make sure that something isn’t getting overwritten. The aiming part of the code is exactly how I explained to be and sent in my screenshot in the previous posts, and I followed this video to implement the mini planet gravity: https://www.youtube.com/watch?v=CZK7QplEbJs
Here’s the result, was this your objective?
As you can see, I can shoot where I’m looking at even while walking sideways
Note: I forgot to insert a bone name into the socket name but after doing that, the incorrect and inconsistent start location of the line trace gets resolved
Hi bro! Sorry i didn’t answer you yesterday I couldn’t send more replies for 24hs because this account is new.
Now answering your post, I think maybe I didn’t explain myself really well this mechanic also works on mine but I have have the problem with the AimOffset that gets te pitch value of my character to play the animation aiming up and down, this pitch value changes depending on where I am on the planet. I don’t know if I am explaining myself. They won’t let me send a video because this is a new account.
This is my AnimationOffset, as you can see it goes to -90 to 90. I get this value from “get camera manager” and then “get actor rotation” which I get the Y vector value. I get the variable “AimRotationAnim” that I use in the ABP to transition and make the character look up and down.
I hope you can understand me!
I see. I’ll inspect the part where you handle aiming tomorrow, meanwhile can you also try to implement a similar thing to your aiming animation to what we did with the shooting / aiming logic
Ohh I think I see something. Not sure since I’m not on PC rn but I see you do something with gravity there. Like I said before, I didn’t do anything extra in my case. My animation part also works! Can you remove those complicatated stuff where you take some values from the aiming logic we did and modify them to use in your rotatation logic for aiming? Just a plain simple aiming should work
That’s the continuation of the previous picture right? Yeah can you attempt implementing a more simple aiming? Just wherever the control rotation is around y and z axis.
Hi! I just came back from work. Yes that’s the continuation of the previous picture. And how can i implement the aiming like you say? What should I delete from this part of the blueprints?
What I meant was, you don’t actually need any of those to make your character aim. All you need to do is just rotating upper body / arms or whatever you want to the control rotation, that’s all. I’ll check what exactly I did in my project to make sure but that’s pretty much it there’s nothing extra if I’m not mistaken, I think you can pull it off until I wake up which is actually… pretty soon (i should be sleeping rn )
Oooh haha i don’t really know how to do it like you say xD. I will be trying that all night then. haha brooo go to sleepp!!! You need to rest! Have a good night!
This is a state inside my animation blueprint. It gets triggered while I’m holding right click. The base pose is connected to a bigger locomotion and the blend pose is connected to an aiming animation which is also connected to the upper body slot. So actually upper body is what’s connected to that blend pose pin. This way, all those other animations within other states keep running on my character’s lower body and I can play the aiming animation for the upper body and on top of that, rotate it’s spine (therefore all the other bones that it inherits, like neck, head etc.) using that yellow node there. What bone you should select depends on your model, but let me also show you how I set that Aim Rotation variable.
Which axis to plug in which depends on the rotation of your bones, so keep that in mind here, but you can just randomly try since there aren’t many combinations anyways
I hope everything’s more clear for you now. Like I said, those calculations you make with gravity direction aren’t needed and something as simple as this will cause you no problem while you try to aim while walking on walls as the gravity pulls you sideways. I could also inspect your code and maybe even fix it (btw it might be because your character already rotates and you take the direction of gravity into account again) but this is a more organized approach in my opinion, and most importantly, it works in that scenario too without having any need to do anything extra! Give it a shot!
Hi bro! Thank you so much! I will try and do it right now. On the second photo you get the actor rotation form the mesh or from a new variable rotator or from the character blueprint?
And in the first photo the main pose is the idle one? and the second one should be conected to the AimOffset?
You are the best!
That pin you ask is connected to the character blueprint as this is in fact inside the animation blueprint and I’m casting the character from there.
Sure you can do that, but then it won’t walk while aiming so it’s connected to a locomotion that has all the other animations inside, including the idle animation.
You mean the blend pose pin? I got an aiming animation which is plugged into the upper body slot, and that upper body slot is plugged into that blend pose pin
I did it like this and it says I need to choose one bone. What bone and where should i plug it?
A locomotion is a blendspace with my idle and run animation right?
You don’t plug a bone to the node. You choose it from that window on the right side. I don’t know about the model you use, but you get the idea, like we turn around slightly above the waist right? Whatever bone is equivalent of that in your model.
No, they are locomotions that hold different states with their transitions inside them. To do that, you create a state machine and drag out of it, and select “use cached pose” which is what’s connected to that base pose pin in my case.