Another trick which I haven’t found anywhere;
Add EventTrack to Timeline, set the key in it at the time we want. Make a connection from it to its Stop. In this way we end the Timeline before the minimum time of 1 second
So another obvious thing that I haven’t been able to find anywhere on the internet - a jump system without physics.
Everything I did looks like this;
We press the jump button, then we set the variable that activates the collision recognition (as opposed to using Linetrace, this time I created a regular ColissionBox on the front of the ball, in this case it reacts faster and the ball does not hit the obstacle).
Another ColissionBox on the bottom is still missing here, which it will recognize when we land on the floor.
We set the actor’s current location to the StartV variable.
We set the EndV variable by adding the starting vector to the upvector, previously multiplied by the value that determines how high we want to jump.
We set the EndV_2 variable by adding the starting vector to the forwardvector, multiplied by the value that determines how far forward we want to jump.
We go further to Timeline → PlayFromStart.
We set SetActorLocation as the output of Update.
To NewLocation Input we put the sum of two Lerp;
First is responsible for moving the ball up and down in A with StartV, in B with EndV, with Alpha as having a simple positive parabola.
The second is responsible for moving the ball forward, in A having StartV, in B having EndV_2, with Alpha as having a linear 0-1, moreover in Output, before the result is summed up to the first Lerp, you have to subtract the vector taken again from StartV, so that the end result would not be StartV two times added.
The curves look like this for me;
After the time determined by EventTrack, the falling down animation begins.
If a collision is detected, the jump animation stops and the bounce animation begins followed by the falling down animation.
It’s still not smooth, but I’m working on it.
I did a jump without physics also. I used finterp to control things. I found a timeline had a bit of a fixed feel to it.
It looks like this ( spherical planet )
I basically had this on tick
There’s a lot more to it ( bit of a mare ), but there’s a trace constantly going on to decide how far I can change the capsule distance variable.
Another success!
Squeezing the ball regardless of its location or rotation.
The only thing I found was this material How To Export Squash & Stretch Animation To Unreal Engine - YouTube
His solution rests half on the object’s skeleton and bones, but the mechanism works without it.
So we copy his nods and paste into our sphere material;
it should look like this for us;
We create an instance of the material. In our actor’s Construction Script with a ball, we create a Dynamic Material Instance;
And in the Event Graph, in the selected place, we set the direction of compression (if we want the ball to be compressed from above e.g. when the ball falls to the ground - we choose GetActorUpVector, if from the front and back, e.g. when the ball hits the wall - GetActorForwardVector) and in the selected way (here using Timeline) we modify the Scalar value, i.e. the pressure force (value 1 is the default, value below 1 and above 0 squeezing the ball).
What’s more, we scale up our sphere so that it recomeps it in a proper way, which gives the visual effect of pushing away excess material on the side under pressure;
The final result should be something like this;
Nice
I need your help. I have created a whole system that getting the location of the floor cubes and loads them. Saving these locations to text also works, and you can copy, paste, and load cube locations from that text, and it works.
However, only up to the locations.
The problem is with class names if I would like my game to have several types of floor cubes or even coins to pick up.
I am unable to convert a given class name from String to Object Reference / Class.
If you want to have different kinds of blocks and coins, you do that with blueprint inheritance.
Everything that’s always going to be the same, goes in the parent. Everything else, goes in the child. Then you don’t need to worry about what class something is, because they are all the parent class.
Why are you converting everything to text?
Why bother with that when you can save the locations directly?
I’m going to create a map maker. I want the player to be able to convert the map they created to a text file so that they can easily share their creation.
Maybe it would be possible to compare whether a given line in Arrey equals the word Box and then use SpawnActor with the Box class, but when a given line is equal to the word Coin, change the class in Node SpawnActor to Coin?
Yes, you could do a simple conversion. Coin1, coin2 etc. Same for the blocks.
Everything works surprisingly well.
I changed the variable from Object Reference to Class Reference as I only need the parent name.
I have Actor BP_Box, I have his child BP_Child.
Converting from String to Class looks like this;
In case of more children, probably more Branches will suffice.
In the near future I will try to make the whole system more neat and make it available for free at a market, as you can’t find anything like that anywhere.
It looks nice. A dodge you could use to cut out the branches altogether, is to keep the classes in a map, the key to which is the string name.
So, I created a Map Variable with possible classes as String and Class Reference, I use Find Node to find a given String from a String Array, which outputs the result as the corresponding Class, which I put in the given line of the new Class Array.
And WOW it works!