0
\$\begingroup\$

I'm now doing a racer on rails like "Outrun". I do have a cool Script from internet that makes the camera and the player follow the Waypoints. The Waypoints are Trigger shapes. I have a level generator that generates road with those Waypoints. However when I hit play and the road is generated, many of the Waypoint triggers have different rotations than in the prefab objects they stem from. Like this : enter image description here

enter image description here

They seem to differ in size too. I have a suspicion that it is connected to some kind of parent-child scaling problem, but I can't really find it. I do need to add waypoints of newly generated chunk to the waypoint list for camera movement. So it is very important to be able to easily find all waypoints of the chunk under one parent for example.

Have anyone dealt with this problem ?

EDIT. 25.11.23 I have a chunk hierarchy that contain all individual chunks that can be spawned: Chunks

The level generator has a list of scriptable objects that contain all possible chunks variants that start and end in a proper direction:

enter image description here

They are spawned as they are there is no rotation at this point. The only rotation and scaling that occurs is in the chunk asset itself. I scaled the base of the chunk from a cube and made other objects it's children: enter image description here

Which means all the children objects have this fraction number scaling, like with the road : enter image description here

Which also has some rotation, but always spawns correctly. But some checkpoints are not spawning correctly at all. As shown above. This is their structure: Parent Obj CheckPoint

The first one is always tilted in some strange direction. The tilt changed once after a rescale in the chunk asset but other than that it remains constant.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ How are you spawning these objects currently? If you suspect there could be a problem with scaling in the transform hierarchy, document what scales you're using at each level of the transform hierarchy. Remember that we have no access to your project beyond what you show in your question, so err on the side of over-explaining to be sure we have all the details we need to reproduce the problem and test potential fixes. \$\endgroup\$
    – DMGregory
    Nov 17, 2023 at 2:29
  • \$\begingroup\$ @DMGregory I edited the post. Sorry it took that long but I was away from home. Is that any better after my additions ? \$\endgroup\$ Nov 25, 2023 at 0:02

0

You must log in to answer this question.

Browse other questions tagged .