Jump to content

RigidBodyWaitForTerrainLoad


Mike P

Recommended Posts

I'm just doing a test scene and I have my own test character in the scene.  Everything works fine with the exception that when the scene first loads I have the character/rigidbody frozen (did this as a test for an upcoming feature will be adding to the character) and the "RigidbodyWaitForTerrainLoad" Component just destroys itself as it's not detecting the player transform is in the scene/terrain m_bounds therefore the "ActivateRigidbody()" method is never invoked as the "RigidbodyWaitForTerrainLoad" component was destroyed due to m_terrainScene being null or empty.

//Find the relevant scene
foreach (TerrainScene p in TerrainLoaderManager.TerrainScenes) {
	if (p.m_bounds.Contains(transform.position)) {
	m_terrainScene = p;
	m_watchedRigidbody.useGravity = false;
	}
}

So the above when it runs on startup before the first frame is updated, "m_terrainScene" is always null even though the players transform is clearly in the terrain/scene.

Not doing anything special here with the player/character. Just replaced the ThirdpersonCharacterController player with mine(stripped down all the components I had and replaced them with the very same components that were on the original ThirdPersonCharacterController player.  Updated any references for the character/player that needed it.  Player spawns in and stays frozen. I have a character reset script I added to the character to unfreeze the character/player as the temp fix.. But wanted to pick your brains on why this could be happening?  Been looking it over for a little now and it's not making sense after putting in some console output, the transfer is there when the scene loads but not in the bounds?

Thank you,

Edited by Mike P
fixing content
Link to comment
Share on other sites

On 12/31/2021 at 9:01 PM, Mike P said:

I'm just doing a test scene and I have my own test character in the scene.  Everything works fine with the exception that when the scene first loads I have the character/rigidbody frozen (did this as a test for an upcoming feature will be adding to the character) and the "RigidbodyWaitForTerrainLoad" Component just destroys itself as it's not detecting the player transform is in the scene/terrain m_bounds therefore the "ActivateRigidbody()" method is never invoked as the "RigidbodyWaitForTerrainLoad" component was destroyed due to m_terrainScene being null or empty.

//Find the relevant scene
foreach (TerrainScene p in TerrainLoaderManager.TerrainScenes) {
	if (p.m_bounds.Contains(transform.position)) {
	m_terrainScene = p;
	m_watchedRigidbody.useGravity = false;
	}
}

So the above when it runs on startup before the first frame is updated, "m_terrainScene" is always null even though the players transform is clearly in the terrain/scene.

Not doing anything special here with the player/character. Just replaced the ThirdpersonCharacterController player with mine(stripped down all the components I had and replaced them with the very same components that were on the original ThirdPersonCharacterController player.  Updated any references for the character/player that needed it.  Player spawns in and stays frozen. I have a character reset script I added to the character to unfreeze the character/player as the temp fix.. But wanted to pick your brains on why this could be happening?  Been looking it over for a little now and it's not making sense after putting in some console output, the transfer is there when the scene loads but not in the bounds?

Thank you,

Instead of replacing the third person controller if you are using your own player and camera you could just use the Gaia's Custom Player. 
 

 

Link to comment
Share on other sites

On 1/8/2022 at 1:28 AM, Bryan said:

Instead of replacing the third person controller if you are using your own player and camera you could just use the Gaia's Custom Player. 
 

 

@Brian Yes. agreed.  My original thoughy too, but I didn't like the way or means PW was removing things if I changed over to a Fly Camera, etc... Was easier this way as I just had to delete the Ethan bones and renders and replace my characters.  Had to modify a few scripts as well so there would not be preload and launch issues.  I really wish PW would provide some override functionality to some methods.  I know the original intent is not to really be using the Gaia Player, etc.. in final product but would help until perhaps it's truly time to 'insert' those player characters, etc..  Hopefully that came out right, tired...

 

However, getting back to the original issue though. Even if I use Thirdpersoncontroller with the default Ethan character, the bounds snippet posted above is never executed as it's finding the Gaia_Runtime and/or Gaia_Player GOs and using them so it destroys the 'RigidbodyWaitForTerrainLoad' Component which then leads to 1 or more errors and sometimes other issues...

Edited by Mike P
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...