What is the best way in general to add objects to the world on the fly?
this getWorld() method only on the objects that are currently in the world and if we dont want to add an object to the world but need to access the method of its class then it throws a null pointer exception.
And if we add the object to the world to access getWorld() then we would need to add extra object, which I dont want to do.
is there any alternative to get the world and add an object?

