Announcement

Collapse
No announcement yet.

Enabling other type of movements based on timing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Enabling other type of movements based on timing

    Hi,

    Basically my character move from platform to platform in a single "dash" or "rush", I aim at the platform, click fire and the player move toward that position at a certain speed until a collision happens, in which case the player will stop moving.

    Now what Im trying to set up is something I call an "insta-dash", which is basically, if the player reclick somewhere in the 1 or 2 seconds following a collision, than he will instead insta-dash, which is basically just dashing at a faster speed. If he fails to input fire during that 1 or 2 second time, then he will instead do a regular dash.

    Can somebody help me set it up? I don't know what node to use to compare and stuff. Visual help would be much appreciated

    Click image for larger version

Name:	Insta.jpg
Views:	1
Size:	304.7 KB
ID:	1138000

    #2
    https://docs.unrealengine.com/latest...ers/index.html

    Most functions are available in blueprint as well, you can use it after collision to set a boolean to true and another event(delegate) to set boolean to false.
    However, you can only have 1 timer for 1 event/function, try to set another timer will reset the existing one.
    Unreal Engine 4 Game Framework diagram for relation of all major base object types
    Unreal Engine 4 Input Event diagram, scroll down to section Input Processing Procedural
    Resident Evil Classic Camera
    RPCs official document, Must Read
    Everything you should know about replication

    Comment


      #3
      Thanks for the answer, altough im having trouble setting it up in blueprint.
      Would it be possible to provide visual example of what I should be doing?
      Thanks!

      Comment


        #4
        It may hit the performance slightly harder (not sure, if it does then it seems negligible), but it's much more intuitive IMO to use Timelines instead.

        Timelines are super flexible and are really really solid in terms of their firing rates (moreso even than delta-compensated tick), it's pretty trivial to use them too.

        To create your window, you simply have the press/release commands for your click input set and unset a variable. Then when you want the window to open (i.e. after collision), first unset the "pressed" variable for your click so clicks before the window don't register, start a timeline (play from start) and have its "update" pin shoot into a branch that checks if "pressed" is true (i.e. You must press click AGAIN during the window).

        By setting the Timeline's length you can adjust the length of the window for insta-dashing.

        I use Timelines for all sorts of stuff like this; I think the control BP for my player character has over two dozen timelines used for various things of this nature (making certain attacks cause the character to float for a period of time, checking if a button has been held for a certain length of time or if it's been pressed in a certain window, checking if one variable goes true within a certain time of another going true, etc) and it doesn't have any appreciable impact on my game thread ms.

        Comment

        Working...
        X