x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Lightspeed Dash?

Hello, I am creating a 3D Sonic the Hedgehog fangame and I was wondering if it is possible to replicate the LightSpeed Dash technique from the games. Here's how it works: "It allows the user to travel along a trail of Rings at light speed, even in mid-air, which can allow access to new areas or by means the only solution to pass through certain sections." ~ The Sonic Wiki Note: I've attempted to have it only spline driven but I couldn't, there would be too many confusing components for me to handle. If you can figure it out, I'd really appreciate it if you could give an image as I learn visually. Thank you.

Product Version: UE 4.14
Tags:
more ▼

asked Feb 18 '17 at 05:08 AM in Blueprint Scripting

avatar image

Alpha Develop.
12 2 3 4

avatar image ill_EatYourDonut Sep 01 '18 at 09:49 PM

did you have any luck ?

avatar image G1K777 Sep 02 '18 at 10:32 PM

This is unreal engine, your imagination is the limit.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

The simplest solution I can think of off hand would be to have some sort of blueprint function tied to your rings that gets triggered when you do the input in front of a ring. (It was B for SA2B on the Gamecube, if I recall correctly. :p)

What you'd do next is have the ring either perform a process, or supply the variables needed for a process in Sonic that is needed for a very short-lived function that lerps Sonic from his position to the position of the ring (if it hasn't already been collected). It would then supply the next ring to the function, and if that was valid as well, it would also be lerped to. It wouldn't be the exact implementation- as I think you could light-speed dash off of a single idle ring in that game, and it would only work for one direction, but it would create a very fast, highly controllable chain of movement that gets you something that looks a lot like the light-speed dash.

Let me know if you want me to go into more detail on this, or if you think you could take it from there.

more ▼

answered Sep 02 '18 at 02:01 AM

avatar image

Chaosian
111 4 12 12

avatar image ill_EatYourDonut Sep 02 '18 at 12:42 PM

If you could go into more details on this would be fantastic ;)!! i really appreciate your help in advance. Currently trying to learn more since im new

avatar image ThompsonN13 Sep 02 '18 at 03:30 PM

along the lines of the above answer you basically would create your own loop which moves your character each time the loop runs. first you would create a actor which will control the loop (you could do it in the level bp but it will be much easier and better as its own actor). this actor will need a a way to know which rings it will have the dash to so you will want to create a public variable which is an array of the type of your rings ( this may be a actor bp or a static mesh). this variable will allow us to populate the array with actors in the level via the details panel once this blueprint is placed in the level. now the script we will use for the loop will be based on a custom event so we will need a trigger which tells the script to start, to do this i would use a on begin overlap with a box collision (see actor begin overlap event in picture). this way if we place this actor overlapping the first ring the script will be triggered when the first ring is collected.

capture.png (487.4 kB)
avatar image ThompsonN13 Sep 02 '18 at 03:30 PM

now on for the main loop of the script, see the below picture for an example. to start off we need a custom event, i named this speed rush. next we need some code that will control if the loop should be run, this basically tells the loop when to stop running actually. to do this we need a variable named index of type int. we then need to get our array and get its last index (this is important since we want the dash to stop at the last ring). we then compare the index to the last index, if the index is greater than or equal to the last index then we stop the loop, this would be the true pin on the branch node. if the index is less than the last index that mean that there is still rings to move to so we move on to the next part of the script where we move the player character. this section basically just moves the player from point A to point B over a specified time via a timeline. the timeline i used in the example is just a float track that goes from a value of 0 to 1 over 1 second. to get the location to move between we just use the index to get the ring where we are currently located from the array then for the target location we do the same thing but we add one to the index so we get the next ring in the array. we then lerp vector and set the location. a lerp will give a value between a and b based on the alpha, this is therefor based on the timeline. the timeline gets updated rapidly possible on tick so it looks like smooth movement. the last thing we need to do is to increment the value of index and run the loop again, this is the script off of the finished pin. it runs the script as many times as it can until the index is equal to the last index of the array.

alt text

capture.png (487.4 kB)
avatar image ThompsonN13 Sep 02 '18 at 03:39 PM

the last step in all this would be to place your actors in the level and set the rings variable. if you look at the picture below the raptors are my rings and the highlighted box is my speedrush bp. so to set the variable (make sure you checked the eye icon in the bp next to the variable name on the bottom left) just place your speedRush actor in the level in the same place as your first ring in the set. then with it selected go to the details panel and look for your variable, then click the + sign for as many rings as you want to add and set the value for each via the dropdown.

hope this helps set you on the right track.

alt text

capture2.png (1.1 MB)
avatar image ill_EatYourDonut Sep 02 '18 at 03:52 PM

I just got home i'm about to mess with it !. Thank you so much for taking the time ;D. do you have discord ?

avatar image ill_EatYourDonut Sep 02 '18 at 07:11 PM

static mesh component object is not compatible with array. from the ring mesh to the get array

rings.jpg (516.7 kB)
avatar image ThompsonN13 Sep 02 '18 at 07:30 PM

your not doing it like i did. if you want your rings to be just static meshes then have them as meshes and place them in your level, then you would switch the array type to static mesh. i used a variable array in the example so you would have a more versatile blueprint, basically you can add as many coins as you wanted to the dash this way, if you were to do it the way your trying to do it you would be limited in how many coins you could have and forced to use one number. my method uses references to actors in the level.

also from the branch you want the true pin to not be connected to anything. if you do connect it then you would end up with an infinite loop which would crash your game.

avatar image ill_EatYourDonut Sep 02 '18 at 08:05 PM

what do you mean by switching the array type ? im just confuse. I already have my rings working and everything im just stuck.. also on the bottom of the picture what is the speed rush attached to ?alt text

rings.jpg (401.2 kB)
avatar image ill_EatYourDonut Sep 02 '18 at 08:06 PM

i guess im just more of a visual learner.

avatar image ThompsonN13 Sep 02 '18 at 08:23 PM

alright let me see if i can explain, the script your creating doe not go in the ring bp, you need to make another actor for the dash script that ive been showing. think of it like this your probably going to have some rings that arent part of a dash set right, so you dont want the script in the rings.

now on to the next issue you need to create a variable that is an array. to do this click the + sign next to where it says variable on the bottom left of your screen. now select the variable you just created and go to the details panel, there you will see variable type. set this variable type to the class that your rings are, so in your case gold_rings and make it a object reference. now to make it a array click the symbol next to the variable type dropdown, this will show you another dropdown of symbols, select the one that is 9 squares as shown in my picture this makes the variable an array. also with the variable still selected go back to the bottom left and check the eye icon so that it shows open this makes the variable public. making the variable public enables you to modify its value via the details panel when the blueprint is selected in the level.

as for your last question the node you want is an increment int. just drag off of the index and in the search bar type ++. what this node does is it takes in a variable int then adds one and sets the variable. you could do the same thing with a int + int and a set node.

avatar image ThompsonN13 Sep 02 '18 at 09:07 PM

i made a little video to show the script and a little of what i was talking about. its not a great video but ill link it below (its 720p and unscripted).

https://youtu.be/hm4OHh7LG5A

avatar image ill_EatYourDonut Sep 02 '18 at 10:17 PM

perfect !! thanks man !! for some reason my character teleport from the new ring actor to the gold one, other than that everything works fine. ill figure out how to toggle the light speed dash through a key

avatar image ThompsonN13 Sep 02 '18 at 10:25 PM

what do you mean the new ring actor? the stuff i provided was just to move your character thats all. its meant to move the character along a set path based on the ring locations. if i understand what your saying right then all you need to do is to move the bp i showed you to make to overlap the first ring.

also this isnt a fully realized system in my opinion, i would think that you would want something where if the player picks up ring two instead of ring one then they still move along the path.

if your just looking for a basic dash thats not along a set path then you dont need any of this.

avatar image ill_EatYourDonut Sep 02 '18 at 10:42 PM

im trying to use it with the current rings i have. I'm recreating radical highway from sonic adventure 2 and there's a part on the map that i would like to use this feature. My ultimate goal is to learn and make something decent

avatar image ThompsonN13 Sep 03 '18 at 02:57 AM

thats why i asked why you said new ring actor, its a bit confusing the way you said it. also i never played that game or any sonic game that wasnt on genesis haha

avatar image ill_EatYourDonut Sep 03 '18 at 12:10 PM

Sorry I should’ve of explained it better lol. Like I already have the rings ready and everything. There’s soo much I’d like to do but my knowledge is not there, I’ve watched numerous tutorial but everything seems so confusing

avatar image ill_EatYourDonut Sep 04 '18 at 02:53 PM

Could you please point me to the right direction to where I can do this homing attack ? https://youtu.be/7phr-2H7Yv4 I have the jump already made is just targeting the enemy or object. Thank you

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question