and why does the page create like a black rectangle on the top whenever I try to render something on the dom?
by user 483253293477265409
and why does the page create like a black rectangle on the top whenever I try to render something on the dom?
by user 483253293477265409
Camera: this looks a bit like you have multiple scripts trying to control the camera - could that be the case? E.g. third-person controller and orbit camera
Black rectangle: looks like you’ve added some content to your HTML page – the Needle Engine element flows like any other page element, so if you want to have overlay UI you usually want to make an absolute positioned div with top = 0 and left = 0 and put your UI into that
That looks like a fun world by the way, great job!
Oh thanks I see, is there a way I can implement another camera that doesn’t involve the orbit controls? I have that one because it was in the third person controller sample but I don’t really like how the camera moves on their own and I didn’t know if I could implement a normal unity camera
by user 483253293477265409
Sure you can of course remove the OrbitControls component in Unity (or disable it at runtime) and add your own implemnetation with a custom component / typescript component.
extension to this question how to make a camera follow a player from script.
by user 406778568597831690
maybe get the player.position and assign it to the camera.position with a lookAt target
by user 483253293477265409
You can also use the SmoothFollow component. It can be attached to the camera and follow a transform that you put inside your player object. That would be a quick way without having to write code