Unity Playgrounds - Interactive Content

My new Babylon Toolkit For Unity - Version 7 Beta will be out soon. I am finally working on new documentation. The new toolkit has been re-architected to be completely independent of the Unity Exporter piece. The Unity Exporter has also been re-focused as an Interactive Content Creation Tool you use Export And Deploy your Babylon Toolkit Unity Projects

For Example, here is a Character Controller Starter Asset package Unity provides:

I created a toolkit project using this asset package to export a Havok Physics enabled starter level and a player character with a BABYLON.AnimationState component and a BABYLON.CharacterController component.

I then created a playground that loads this interactive content and at runtime, attaches an additional
BABYLON.ThirdPersonPlayerController component (The same thing you would do in the editor to attach a script component to a game object): Unity Playground - Sample Scene

Babylon Toolkit For Unity - Version 7 Beta - Coming Soon

10 Likes

Love it! Need two controls for mobile though so you can move the camera, just dragging is not doing it. Otherwise super clean.

Trying to figure out how to use the ThirdPersonPlayerController…how do we access this outside of the playground? Not sure what the PROJECT namespace is.

1 Like

That is class i wrote for the Babylon Toolkit Starter Content. It is part of a Babylon Toolkit Unity Project. When you export and deploy your project, its bundles all your script into a project script bundle. Long story short, you would use the Babylon Toolkit to create your interactive content with scripts.

Or you could really write your own player controller that grabs a reference to the UNITY.CharacterController and UNITY.AnimationState components (from babylon.toolkit.js extension) to move and animate the player controller, just as you would in a native unity project.

Now that you can freely use the babylon.toolkit.js in any BabylonJS project, i will make a playground to show how you would make your own, if you did not want to use the one i provide as starter content

Smells like a leak :smiley:

I will look into that

Hmm… @qq2315137135 … How many minutes before start drop frame rate.

I have been running for the past 20+ minutes and i am still rock solid at 60FPS

It did not even takes any dips or anything like that:

Yo @Deltakosh … Dude… Long Time No Hear. How ya been ?

Can you please check this out on your end as well, see if you get this steady framerate drop until its not playable.

Everyone… Please Help.

Can you please check out the playground and check for steady frame rate decline after a few minutes of running. Like @qq2315137135 was experiencing

@qq2315137135 … So I tried on Windows with latest Edge… Runs rock solid at 60 FPS with no major dips

Yo @Deltakosh … I don’t believe there is a memory leak, I have battle tested this framework for a couple years now. Been using is at my company to create commercial projects that we sale and support to major clients (I’m under NDA so I cant say exactly who they are and the details of the projects). But we never had a memory leak like @qq2315137135 was experiencing. That must be something with his browser version or the state of his machine or something.

Note: We always recommend Chrome Browser for the best experience. But again, have never experienced a leak in Chrome, Safari, Opera, Firefox or Edge (I cant speak to the exact version of Edge)

FPS seems solid to me, but in general when looking for FPS drops you should look at “Absolute FPS” instead of just “FPS”, because “FPS” is capped by your monitor’s framerate. So if there was a drop from 800 FPS to 70 FPS you wouldn’t notice, but someone on a 144hz monitor would.

Is the camera collision avoidance part of the unity toolkit? It seems like a useful tool applicable even for people who aren’t using unity for anything.

At the moment, my framerate is stable here too, so it’s probably some kind of environmental bug.

The camera collision is actually Havok Physics (But i had the same thing running smoothly with Ammo.js as well). My camera system uses a Camera Boom Arm Vector (0,0,-5) for example. I do a sphere shape cast from the camera boom position to player look at point. If i hit any other collider i smoothly move the camera forward on the Z so its closer to the player up to min camera distance. This is pretty standard and NOTHING for Havok Shape Casting. So i doubt if the camera collision part has anything at all to do with it.

It is probably some environment thing on @qq2315137135 machine.

If you wanna take a look at how get reference to other components like UNITY.AnimationState or UNITY.CharacterController you can take a look at my Uber Third Person Player Controller. It handles all the logic for Player Movement, Player Animation and Smooth Boom Camera Movement:

ThirdPersonPlayerController.ts.zip (14.6 KB)

My camera system uses a Camera Boom Arm Vector (0,0,-5) for example. I do a sphere shape cast from the camera boom position to player look at point. If i hit any other collider i smoothly move the camera forward on the Z so its closer to the player up to min camera distance.

Oh ok! We do something very similar at my company, but instead we’re using a Rapier physics raycast. Tried using a Babylon raycast first, but was not performant at all. So I agree, if you’re using a phsyics based shape cast that is probably not something impacting performance.

Hey mate! I was still around but super busy:) I should be able to come more often soon!

1 Like