Hi, great template. My question might be a basic one since I am still a beginner/learning Godot. So, I got your template (which is fully functional). In my tests I changed the camera/cars/expanded track and a few other details ... but when the race is completed (like all cars pass thru the finish line and shows the podium), I was trying to change scene (with a simple button in the podium window). At that point, the game crashed referencing two lines in the if statement (in car_controller.gd) ...
if is_AI and RaceManager.is_countdown_finished:
# Calculate the direction to the target
var target_direction = (waypoints[current_waypoint].global_transform.origin - model.global_transform.origin).normalized()
# Calculate the cross product of the car's forward direction and the target direction
var cross = model.global_transform.basis[2].cross(target_direction)
So, I added a silght modification to your code ... but cannot manage to fix the issue. Here is what I did, might be helpful ...
if is_AI and RaceManager.is_countdown_finished:
# Check if the model and the current waypoint are still valid and inside the tree
if is_instance_valid(model) and model.is_inside_tree() and is_instance_valid(waypoints[current_waypoint]) and waypoints[current_waypoint].is_inside_tree():
# Calculate the direction to the target
var target_direction = (waypoints[current_waypoint].global_transform.origin - model.global_transform.origin).normalized()
# Calculate the cross product of the car's forward direction and the target direction
var cross = model.global_transform.basis[2].cross(target_direction)
Now it does change scene, but the cars from the previous race remain in the middle of the screen, and if I try to select a car for a new race ... it crashed again.
My plan was for making a restart race or go to next race ... but trying to change scene just leads to another crashed game.
← Return to tool
Comments
Log in with itch.io to leave a comment.
Is there a demo available?
Hello! Can you, please, add pay with card option?
Hi! I am sorry but in my country credit card is not an option due to some government policies. Do you have Payoneer, wise or Skrill?
Hi! Now you can buy me a ko-fi with a credit card for the same ammount and I can send you the key to download the template.
https://ko-fi.com/rnbgames
Clearly, Godot needs its own "Assets Store" ASAP!
I agree!
Hi, great template. My question might be a basic one since I am still a beginner/learning Godot. So, I got your template (which is fully functional). In my tests I changed the camera/cars/expanded track and a few other details ... but when the race is completed (like all cars pass thru the finish line and shows the podium), I was trying to change scene (with a simple button in the podium window). At that point, the game crashed referencing two lines in the if statement (in car_controller.gd) ...
if is_AI and RaceManager.is_countdown_finished:
# Calculate the direction to the target
var target_direction = (waypoints[current_waypoint].global_transform.origin - model.global_transform.origin).normalized()
# Calculate the cross product of the car's forward direction and the target direction
var cross = model.global_transform.basis[2].cross(target_direction)
So, I added a silght modification to your code ... but cannot manage to fix the issue. Here is what I did, might be helpful ...
if is_AI and RaceManager.is_countdown_finished:
# Check if the model and the current waypoint are still valid and inside the tree
if is_instance_valid(model) and model.is_inside_tree() and is_instance_valid(waypoints[current_waypoint]) and waypoints[current_waypoint].is_inside_tree():
# Calculate the direction to the target
var target_direction = (waypoints[current_waypoint].global_transform.origin - model.global_transform.origin).normalized()
# Calculate the cross product of the car's forward direction and the target direction
var cross = model.global_transform.basis[2].cross(target_direction)
Now it does change scene, but the cars from the previous race remain in the middle of the screen, and if I try to select a car for a new race ... it crashed again.
My plan was for making a restart race or go to next race ... but trying to change scene just leads to another crashed game.
Please advise,
Thanks in advance.
hi! Reach me at my discord server so I can help you:
https://discord.gg/FTSmxZtY3W
And I will do my best!
I am working on a "select race track menu" so I think I may know what you need to change.
Thanks
Can I adapt it to use in a commercial project?
Of course!