The AnimBP I have a state machine similar to the 3rd person jump tutorial. Each state has an animation in it - no montages or blendspaces. I’m guess this is not the way to do it. The conditions are set up the same as the jumping tuts. ie. ‘Isfiring’ >>>‘time ratio remaining’ > 0.1 >>>>>>‘IsFiring’ NOT>>>>>time ratio remaining > 0.1
5 In the Anim Event graph. I cast to myCharacter to get ‘IsFiring??’ and the Set the ‘IsFiring’
In stead of using… “Try Get Pawn Owner” node… you should use… “Get Player Pawn” node… hooked into the cast node, because the anim blueprint does not belong to the player, so you can’t try and find the owner, but rather find the player pawn. So you hook that into your current cast, basically keep everything else the same, I THINK it should work then.
Technically, shouldn’t the isFiring bool be on the bow itself AND the player? Because the way you have it now, the bow has a dependancy on the character, whereas if you had an isfiring bool on the bow as well (which you would change as you changed the one on the character) then the bow would be self-contained. You’d simply cast to bow instead of player and get its var.
Sorry I’m a bit stuck on this. I’m trying to do the above but when I cast to the bow in the anim event graph it fails. I can cast to my character just fine but anything else seems to fail. Does anyone know why this would be? It’s regular BP based on actor.
It just seems to be something that when happens can be fixed by doing it the other way round. I’ve come across the multiple times and never found the answer. Trust me, As an author of three books about UE4, I make it my business to know when something doesn’t work right. But no matter how much I research, I’ve never found the answer
Oh ok so it’s a bug of some description, thanks for clearing that up. I should’ve asked here earlier, coz I’ve tried lots of different projects and bps and always hit this same casting problem.
So are you saying cast to the bow animbp from mycharacter and trigger the bow animations from there or something else? lol I’m totally confused.
I would really like to get my projectile code out of mycharacter and set up a Weapon parent and have children bps for bows and other weapons (all will be needing their own animbps) but if casting to them is this problematic I don’t know what I should do.
If you know of any tutorials for setting a weapon system up like that please let me know. I’m struggling to find much on weapons in general…especially animated ones.
I must check out these books of yours. Weapon system by any chance?
I’m a bit lost with what to do in both now tbh. Like what should my anim event graph have in it now too?
I was starting to get my head around the event graph with casting but now it’s a bit backwards and has thrown me.
Are you able to show me a rough example of what you mean in the charBP and EG?
Substitute punching for bow and arrow and your done.
As a few suggestions though I would reserve Locomotion for just that and put any and all action events into a Montage.
Once a player fires off a Montage they can not pop out of it into another animation Montage and can only play one at a time. If firing a bow for example the player can not switch to a different weapon in mid pull.
You can assign a single conditional event that prevents any other action while still mid Montage.
In a nutshell I have the bow bp that I can’t cast to from within its animBP to trigger it anim states.
It works great if I cast to MyCharacter and trigger them from there but I still need to cast to the bow to hide and unhide the static arrow (which is a component of the bow). I was planning to set up some hide & unhide functions in the bow and use notifies to trigger them within the animBP.
That’s how I did it for the loading arrow in the characters hand.
ps. Man you really have your head aroud the animBP. Are you using some of Kubolds animations in your game?