Closed Andonrai closed 1 year ago
Perhaps readme.md
is not detailed enough and misleads the wrong usage.
You don't need to use @infernus/streamer
separately, as objects/pickups inside @infernus/core
are already using streamer.
Only when you separate from the @infernus/core
library, you'll need to use @infernus/streamer
separately.
The methods of the @infernus/streamer
library are directly created and returned, so it's the same issue as with your previous pickup - it should be created within events instead of outside of them.
import { GameMode, DynamicObject } from "@infernus/core";
const obj = new DynamicObject({
// your object params
});
const gm = new GameMode();
// Everything about game should be in events, such as OnGameModeInit or OnPlayerCommandText
gm.onInit = () => {
obj.create();
obj.setMaterial(/* material params */);
};
If there is still a problem, open the issue again
I am creating an object but it returns undefined and I want to texture.
Code:
exampleObj return undefined