Skip to content

Avatar onClick not dispatched when AvatarAction.Walk is enabled #129

@sindreslungaard

Description

@sindreslungaard

After update ^0.7, when you click on a part of the avatar except the head, the avatars onClick event is not dispatched.

Example:

let shroom = Shroom.create({ application: app, resourcePath: "./resources/flash" })

let room = Room.create(shroom, {
    tilemap: `
    xxxxxxxxx
    x00000000
    000000000
    x00000000
    xxxxxxxxx
    `,
})

let avatar = new Avatar({
    look: "hd-180-2.hr-100-61.ch-210-66.lg-270-81.sh-290-62",
    direction: 2,
    roomX: 1,
    roomY: 1,
    roomZ: 0,
})

avatar.onClick = () => {
    console.log("Avatar clicked")
}

avatar.addAction(AvatarAction.Move) // remove this line and onClick works as expected

room.addRoomObject(avatar)
app.stage.addChild(room)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions