Hi all,
I have a Pawn that needs to jump on z when a key is pressed and should return to its position on the act of key release. I simply created a BP for moving up. The movement is kind of a Step. its not fluidic. I dont know how to return it back to its position on key release. Thanks in advance!
If you donât care by using a step-like movement then try scaling by -1 the vector when you release the flap button like this.
If the actor rotates on any of the X or Y axis this probably wonât work because the Up vector isnât aligned to the Z axis, in that case you could just use the Height variable directly.
Thanks for the quick reply. Actually my BP is resulting in a step movement which i dont want. I want it to be fluidic. I ll try u r method. Thanks once again!!
Hi Kaldosail,
InterpTo will help you achieve some fluidity!
Also note that Iâm using âSetActorRelativeLocationâ node instead of âAddActorLocalOffsetâ
Let us know if you have any more questions.
Hi Astrotronic,
Unfortunately its not working. On the game play, the Board starts to fall down. I dont know wat to do
Are you making a flappy bird?
no⌠this is kind of just a plank and start hitting the ball untill u miss it out
The plank should go up on pressing a key and return to its previous position on release.
The plank is movable in fwd/rwd left and right direction as well. I did the movements. only this moving on z is not working for me
Sounds like weâre making a 3d arkanoid, how close is this:
Is bouncing allowed? If I hold the Jump key, do we stay up in the air?
yeah more or less. btw how did u take this video output?
no bouncing. The more you hold the more higher it can go on
A pawn with a movement component:
Produces this:
The world vector is the speed you go up / down. Make sure you put a negative value as default - think of it as of simulating gravity.
video output?
Gyazo.
Thank you!!. I ll check it out right away.
Thanks for the reply. it works well. But when released its not returning to the position from where it bounced up. becoz of the vector value is negative it keeps falling down on release
Place a blocking collision volume underneath.
Alternatively, check the Z value of the Pawn and if it drops below a desired threshold, stop adding negative input - either with a Branch or Gate.
So, initially, Iâm thinking that you need to create three unique variables: two bools and a vector. For this example, letâs call the first bool âIsOriginalPositionâ (default value = true), the second bool âInitialPressâ (default value = false) and letâs call the vector âOriginalPositionâ. (name the variables whatever you want)
On press, use a branch to check if the IsOriginalPosition bool is true. If it is true, set the vector variable to equal the actorâs current world location and then set the IsOriginalPosition bool to false. Add a do-once node right after that sets the InitialPress bool to true.
Use whatever method youâd like to move the actor upwards so long as itâs while the IsOriginalPosition bool is false.
On release create a branch to check if the InitialPress bool is true. On True, set InitialPress to false and then create a looping timeline.
On the timelineâs update, create a branch that checks if the actorâs world location is (NEARLY) equal to the OriginalPosition vector.
On the false option of the branch, use whatever method youâd like to move the actor downwards.
On the true option of the branch, set the bool IsOriginalPosition to true and then create a sequence node with the first event in the sequence unlocking the Do-Once node from earlier and the second event in the sequence to stop the looping timeline.
Kind of like creating your own moving platform that the player can directly control to some degree. This method should prevent the player from repeatedly pressing the button and continuously going upward before the actor has returned to its original position.
Hi, Thanks for the reply. I find it really difficult to understand becoz, I am a super noob!!.
I will give it a try and let you know. Thanks once gain for the post!!
Is this the result you are looking for?
Exactly
Can you share a screenshot of the bp pls?