"Color4" - Uncaught TypeError: Cannot set properties of undefined (setting 'r')

Hello, I’m trying to use the “Color4” class without importing the full Babylon namespace,
so I’m importing it in this way:
import { Color4 } from “@babylonjs/core/Maths/math.color”;

But it does not work, I get the error
“Uncaught TypeError: Cannot set properties of undefined (setting ‘r’)”

How to import the “Color4” class?
Many thanks!

It sounds more like a runtime bug where the object for which you try to do object.r is undefined.

2 Likes