Jump to content

Setting up Runtime Generated player


FramaFurav

Recommended Posts

So, Here I am again, Sorry to bother you all once more, but as I said in my previous topic, when talking about programming I'm a total dummy.

I have my own first person player rig, using the Ork Framework system to handle it and all the game logic. It is Ork who keeps my player prefab in its memory, and spawns it in each scene using spawn points. I'm doing this because Ork handles the whole Rpg system, and keeps track of all the player stats (health/damage/status/experience points and so on) So this is the reason why I have the need for my player to be Runtime Generated for Gaia. The point is that i simply cannot figure out on my own Where, and How to call the Gaia Api static function.

No matter how I try to set up the Runtime Generated player, at the moment of spawning, the game framerate just drawns down. If i use Gaia Flycam, everything works well, the game has a pretty good framerate. Same if I use the Custom Player runtime, adding my prefab to the scene. So i know it's not a hardware performance problem, or my Rig problem.

I tried creating, and attaching to my player a Script with only the function written into it. But it doesn't work. Maybe i'm just doing it the wrong way.

Ork uses events with nodes, similar to Unreal Blueprints UI for its internal coding, It uses an event to spawn the player into the scene. So I also tried to attach another node to that event, that calls the GaiaApi function. But it seems to have No effect at all. Everything just stuttering a lot.

So as for now i'm running out of Ideas. And i know that is probably because I have No programming knowledge. I'll keep trying whatever comes to my mind. In the meantime i'm asking for your help. It is probably like a basic primary school lesson, but Could you please tell me exactly How can I call that function in my game?

Let me know if you need more information, screenshots or so on. I'm still using Unity 2022.3.10.f1 and Gaia Pro 2023.

Thanks again for your patience 😉 

Link to comment
Share on other sites

Hello, 

Have you had a chance to take a look at this: 


In the runtime section / custom one it says which part of the API you need to use. 
The API should all be marked on each setting on what it's used for. 
 

Link to comment
Share on other sites

Hi @FramaFurav, the Gaia API call would need to be executed once after the player character & camera were spawned. If the game is stuttering, it could potentially be that the API call is done over and over again in a loop / every frame.
You should be able to identify what is causing the slowdown with the unity profiler
We are not familiar with the ORK framework, it is therefore difficult for us to advise what the best way would be to perform this within the means of this framework. I would expect though that if you place this in the Start() function of a script on the player that this should work.

Link to comment
Share on other sites

First of all Thank you very much for your support!

A little update, i'm sure it will make you laugh.

So, I've been trying to switch on and off the various Gaia components, and found out that the main cause for the game stuttering were the terrain biome spawners. I tried to Clear them and make a new fresh biome spawning, and now the games runs smooth like water. Not even needing the Gaia Api thing. 

I'm not sure what caused my problems, I think while following the tutorial I may have double pressed the Spawn Biome, generating an overloaded world? anyway, now It seems to work absolutely fine.

I'll keep you updated if anything new comes out

Thanks again!

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...