Unreal.js icon indicating copy to clipboard operation
Unreal.js copied to clipboard

Hello Character example crashes in version 4.23 (More templates are crashing)

Open Invius opened this issue 5 years ago • 2 comments

Trying to play the helloCharacter level, crashes the editor... After a little bit of debugging the problem lives in this two functions, even spawning only one character, crashes the engine.

function createCharacter() {
        let pos = randomPoint()
        pos.Z += 100

        // All UObject has static function .C({UObject}), which just return its input arg.
        // But *.d.ts has proper type signature for those functions, so we can enjoy
        // auto-completion!
        let character = Character.C(new MyCharacter_C(GWorld,pos))
        character.SpawnDefaultController()

        let controller = AIController.C(character.Controller)

        function wander() {
            controller.MoveToLocation(randomPoint(),-1,true,true,false,false)
        }

        // Move completed?
        controller.ReceiveMoveCompleted.Add( (reqid,status) => {
            wander()
        })

        wander()

        return character
    }

    
    // spawn 20 characters
    let characters = _.range(0,1).map(()=>{
        while (true) {
            try {
                return createCharacter()
            }
            catch (e) {
            }
        }
    })

Edit : After trying this pluggin for 4 hours in the JavascriptPlayground, and testing other examples, i came to the conclusion that without a proper documentation, or functioning examples, its almost impossible to learn this pluggin. For instance, my last test, was to change game mode in the for a simple one in the helloInputbinding level and set the default pawn to custom one, with it i've placed the helloInputBinding script and removed from the level the actor came with it, and the engine crashed.

Invius avatar Feb 28 '20 20:02 Invius

is still an issue? Im very interested in the project trying to see if it is still worth diving into!

Master244 avatar Apr 11 '20 14:04 Master244

I managed to get most of the examples including this one working with multiple versions. Sometimes it does seem to miss certain things and the debugger errors out but it compiles for me. Also with new projects. I managed to get the firstPersonShooter example working as well which does all the spawning etc. I am trying to collect my examples etc to build a website for the documentation. If you have suggestions send me a PM.

Master244 avatar May 04 '20 14:05 Master244