I wanted to spawn the player and move the camera towards the player.
However, if the colliding body is a tree, I cant set the camera target, so the camera remains at Vector3(0, 0, 0).
It was working fine until I made some changes in the player spawning system to add some features using the PhysicsDirectSpaceState.
Below is my code(Not the full one, just the part where I think is related):
There are also some errors, but I'm not sure whether it's related.
Below are the errors:
1) E 0:00:05.594 restinfo: The shape is not a convex shape, then is not supported: shape type: 7
<C++ Source> modules/bullet/spacebullet.cpp:247 @ rest_info()
LandGenerator.gd:290 @ collide()
LandGenerator.gd:295 @ checkCollision()
LandGenerator.gd:145 @ placeObj()
grass.gd:16 @ chooseObj()
biome.gd:58 @ loopFill()
biome.gd:27 @ _ready()
LandGenerator.gd:140 @ placeLand()
LandGenerator.gd:120 @ createWorld()
LandGenerator.gd:55 @ _ready()
World.gd:12 @ _ready()
2) E 0:00:05.618 getpathto: Condition "!commonparent" is true. Returned: NodePath()
<C++ Source> scene/main/node.cpp:1619 @ getpath_to()
LandGenerator.gd:248 @ setPlayerPos()
LandGenerator.gd:269 @ reSpawn()
water.gd:17 @ _process()
Finally, if there is any extra information, data or methods you all need to be able to help me, please ask..thanks...
I've debugged the code for hours, but to no avail...Hope someone can help me soon...