Can't create CollisionShape2D inside KinematicBody2D using script [Error/Bug]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By websterek
:warning: Old Version Published before Godot 3 was released.

HI
I have wird problem in my project.
In a fact this happen from nowhere. Last time when I turn game on everything was fine and line: add_child(CollisionShape2D.new(), true) creates in my node tree CollisionShape2D (inside of KinematicBody2D). But right now i have this Errors:
enter image description here

:bust_in_silhouette: Reply From: Zylann

You might have run in a common mistake: http://docs.godotengine.org/en/latest/tutorials/2d/physics_introduction.html#collisionshape2d

CollisionShape2D is a helper node, meaning that it is meant to be used from the editor. In a script, you should create a Shape2D and use add_shape instead: CollisionObject2D — Godot Engine (latest) documentation in English

Before your answer I have create new project and right it’s become to work again without any changes :confused: You think it’s can be a bug?

websterek | 2016-09-29 19:34

I have no idea tbh, just that CollisionShape2D is not meant to be created by script in a game. So it’s possible some cases are even untested.

Zylann | 2016-09-29 20:20