Im making a project where a ball randomly moves and randomly changes color from red to green.And when it changes to green you need to press space and it measures the time of your reaction.Im struggling with making the measurement of time.I dont know how to measure the time ONLY after the ball changes the color(material) to green,and when the space is pressed the time stops measureing,giving you the time of your reaction.
for some reason it still measures the time as soon as the game starts, and when i press space it just tells me the overall time.
Are you using the right node? GetGameTimeSinceCreation might screw things up…
EDIT: Can you show your code?..
the comment was too large so here is the rest
This is everything.The GameMode nodes are about restarting the game when R is pressed but go figure it doesnt work.I have made the Level bluprint posses the character because if i try with the autoposses player 0 for some reason the AI random movement stops working.Hope these pictures help.
Take out the call to Random that’s in the chain on the Random node and see what happens:
it moves for half a second and then it stops
Yes, but is the timing correct?
for some reason its as if the whole programs stops,the timer is still not correct it just shows the overall time,and the ball wont even change color when i take out the call to Random
I think i have an idea to solve this but im not sure how to pull it off. First i need to know if it is even possible.Because in my Ball_BP are stored all functions like Random,ColorChange,StopMoving and in my Level Blueprint is the SpaceBar event which when press should show time.So in order to make the timer work i will need to somehow make communication between the Level Blueprint and Ball_BP so that the Level Blueprint can know when the color of the ball has been change or in other words when ColorChange event is triggered.
You can do it all in the ball BP. Do you have just one ball?
EDIT: I know it wont work properly without that second call to random. There’s a better way of doing it, I was just trying to figure out the timing problem.
I will knock something together…
sure thing,countin on ya
As soon as i come home i will inform you with a result
did you place all these nodes inside a character blueprint??
would you be up for an idea where we talk on this subject via discord?Because it still seems like the project is missing something.
Or: you can zip up the project and put it somewhere for download and I’ll take a look…
i have sent a request ,my name is pepsi ferrari on discord,and also i can just stream you the project on there