[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

If there is anyone with UE4 blueprint experience on here, would

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 7

File: alreadytriedbooleans.jpg (119KB, 1139x731px) Image search: [Google]
alreadytriedbooleans.jpg
119KB, 1139x731px
If there is anyone with UE4 blueprint experience on here, would be great.

Whenever moveCharacter is run (by pressing wasd keys) it moves the character along a grid. Problem is, i am able to move the character up while also moving it to the right at the same time.

SO, how do I make this so it doesn't execute on of four when one is already being executed?
>>
File: BP_LOCK.jpg (128KB, 1092x707px) Image search: [Google]
BP_LOCK.jpg
128KB, 1092x707px
>>527471
So I assume you want the pawn to only move in 1 direction at a time, ignoring other input yes?

Here's a quick setup I threw together. Mind it will only trigger once per action (so if the action is suppose to repeat whilst the key is held you might need to use Tick repeat the last key action).
>>
>>527480
Its really complicated though because I use UMG touch buttons for moving since it's a mobile game. This means I can't use the equal key node. Movement is already tick for holding the button purposes
>>
File: BP_LOCK_v2.jpg (218KB, 1733x802px) Image search: [Google]
BP_LOCK_v2.jpg
218KB, 1733x802px
>>527577
OK I can't check the multitouch because I've only got KB+M. But I made a UMG widget with 2 buttons. Bound 'Press' & 'Release' events to each button. I used an enum for the actions.

So, when a button is pressed it checks that no other buttons are pressed & opens the gate. The tick event flows through the gate and repeats the move. When a button is released it confirms that it is the same button & closes the gate. The stop move must be sent before you close the gate.

A switch statement selects which action is active and sets up the move. Pic is the UMG Blueprint.
>>
File: BP_LOCK_v2_ENUM.jpg (41KB, 622x566px) Image search: [Google]
BP_LOCK_v2_ENUM.jpg
41KB, 622x566px
>>527577
>>527592
And the enum setup. Note this is a separate object you create in the content browser under Blueprints->Enumeration. Also, the 'action' variable in the Blueprint must be of this type (in my case 'BE_Action').
>>
File: Gate_Example.jpg (6KB, 210x191px) Image search: [Google]
Gate_Example.jpg
6KB, 210x191px
>>527471
I've never used UE4 but this seems like something you'd use logic gates for in a digital logic setting.

Googling led me to this Gate node, if there was one with three "close" inputs (equivalent of a four-input AND with three of the four inputs inverted) you could stick them between each of the outputs of the Switch node and the Branch nodes and then have the remaining three inputs connect to the other outputs of the Switch.

Again, not sure if this is how it works, but as a passing computer engineering student that's what I would do.
>>
File: allBlueprints.jpg (568KB, 1564x1793px) Image search: [Google]
allBlueprints.jpg
568KB, 1564x1793px
>>527592
>>527593
The gate node was exactly what I was looking for. Not being able to move multiple directions at once is working fine now.

So right now it moves the character every tick as long as input is held, with a delay of 0.1 secs. Without this delay it moves way too fast. Only this results in the character teleporting 100 cm's every 0.1 sec. I want it to move smooth as long as input is held, and stop every 100 cm's so it stays on the grid. I tried using linear interpolation with no success. How can i achieve this? Maybe I can round the world location to a hundred when it stops moving, but I don't know how to go about it.
>>
>>527661
A quick way to achieve smooth motion at a constant speed is to multiply your target speed by World Delta Seconds. This would also allow you to get rid of the 0.1 delay. You should be doing this anyway because without that delay your pawn speed is tied to your frametime (i.e. your pawn will move quicker at 60fps than 30fps).

Otherwise why don't you build a vector of the target grid point (i.e. V(0, 200, 300)) which you update with input and use a vinterp to move to it. I'll have a look at it in a bit.
>>
>>527471
You might be better off asking in /v/'s or /vg/'s gamedev threads, this isn't really modeling so much as game design

>>527661
lerp maybe? It sounds like you want the smooth-yet-snappy movement I've seen in some games where it rapidly acc/decelerates, but I'm unsure

>>527672
This as well, any time-based actions need to be multiplied by delta seconds to keep it dependent on time and not framerate (otherwise you'd have people on good phones/comps zooming around while people with low FPS inch their way across)
>>
File: MovePawn.jpg (319KB, 1928x1080px) Image search: [Google]
MovePawn.jpg
319KB, 1928x1080px
>>527661
>>527672
Right I've had a crack at, made my own grid based pawn. So using WASD I move the box is units of 100 up,down,left, right (top-down camera). I do this by setting a vector called 'Step', which will be used to change the 'Target' vector.

Then once the gate is open the 'Target' vector is updated once a second. I then used a vinterp to move the pawn from its current location to the target location. I use bool to check if on target, so when the key is release the pawn will finish the move.

My pawn uasset:
https://drive.google.com/file/d/0B9E7sO5KxRdzYzBlUzlnekFzNEE/view?usp=sharing

You should be able to import this into your project and then change the pawn type in your gamemode to B_GridPawn.

The only issue is a lock-up with the first few movements. I don't know if it is an initialisation thing or where it tries to loop.
Thread posts: 10
Thread images: 7


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.