Can't set target for interpolated camera

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By God Of Theory

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):
https://pastebin.com/D4zcVdG8

There are also some errors, but I’m not sure whether it’s related.
Below are the errors:

  1. E 0:00:05.594 rest_info: The shape is not a convex shape, then is not supported: shape type: 7
    <C++ Source> modules/bullet/space_bullet.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 get_path_to: Condition “!common_parent” is true. Returned: NodePath()
    <C++ Source> scene/main/node.cpp:1619 @ get_path_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…

Have you tried NodePath

'export (NodePath) var target = get_node("where is that node")'

Okan Ozdemir | 2020-05-03 18:34

I’ve solved it,its because I need to delete the previous camera first before adding a new one…thanks anyways…

God Of Theory | 2020-05-07 05:28