I’m trying to make a gem teleport my character to a waypoint, but unless I set the waypoint actor on the instance, it just errors. I can’t set the default in blueprint either.
How could I resolve this?
I’m also likely to add more waypoints along the way too, so I’m also assuming I’ll need a new waypoint for each one?
Sorry, this is the first project I’m expanding on my own outside a course, so I’m a little like Bambi atm!
Hey there @JodieKitten! Welcome to the community! So defaults can be set for anything that isn’t referencing another instanced actor. In this case, you want to set your waypoints that are in the scene as the defaults, however this blueprint has no idea a scene exists until it’s in it. There are a number of ways you can set the waypoints as this object is generated that would also make it futureproof.
Generally it’s advised if you’re going to have only one gem active at a time, you can set the reference when the level starts by using Get Actor of Class. If there’s going to multiple, you can Get Actors of Class and then run a loop over them for criteria like Clockwork mentioned.
How do you want your gems to function? Just as a level change or in-level teleporter?
So I haven’t learnt how to change between levels, so I figured I’ll make one long level and have a gem in each section that will teleport the player to the next section.
No worries! If you’d like you can place an instance of your manager in the level and set the waypoint references directly in that case if you’d prefer. It’s definitely simpler but more work for you in the future!
Or if you’d prefer I can get you resources on levels. Really however you want to go about it. Just the defaults themselves can’t be set to existing things in scene unless it’s already an instance itself.
I’ll definitely give that a try! Sounds simple enough even for me haha.
This sounds like a silly question, but how will the individual waypoint know it’s been used?
Player hits the gem and gets teleported to the waypoint arrow; this way we need no (hard) references whatsoever and no script in the player - it’s going to be a busy class anyway.
And, finally, nothing stops you from having many waypoints and many gems in a single actor - interlinked any way you need. Perhaps the teleport locations are random (pokes @Zof)
Think of the waypoint gem actor as a manager blueprint that controls where the player goes. How to go about it depends on the scope, ofc.
It never occurred to me that you could do that!
Your first suggestion worked perfectly for me and I’m definitely keeping this one in mind for future use, you’ve definitely given me some ideas haha
So I’m completely unable to start a new topic for some reason, so I’ll add it to this post in the hopes it get seen :
My game uses a timer handle to track how long the player takes to complete the game. I’d like it if I could save the end time and use it as a “best score” that is displayed and updated should the player beat it, is this something I could do?
Here’s the HUD display and graph (I followed a YouTube tutorial to get this game going, so any suggestions to improve/change things would be appreciated!)
Oh wow, yeah that’s a much more logical way of doing things, thank you!
How would I go about saving a best score and having it load up and update when it’s been beaten on each game? Sorry, so many questions I really appreciate your help!
Yeah I had a look before but kept getting lost as I was trying to save a timer handle itself as a variable but I should be able to follow things better now I have a new way of setting a timer!