[Feature Request] getPlayerOrientation
It would be great to have a getPlayerOrientation function. At the moment I have a workaround where I place a block in front of me and ensure I don't have any others around me. I then run the following code to set the builders orientation (with the help from the agent who seems to be the only way to detect where the block is). If you know of a better or faster way around this please let me know.
Code to help orientate the builder:
player.onChat("getDirection", function () {
agent.teleport(pos(0, 0, 0), WEST)
if (agent.detect(AgentDetection.Block, FORWARD)) {
builder.face(WEST)
player.say("West")
} else {
agent.teleport(pos(0, 0, 0), EAST)
if (agent.detect(AgentDetection.Block, FORWARD)) {
builder.face(EAST)
player.say("East")
} else {
agent.teleport(pos(0, 0, 0), NORTH)
if (agent.detect(AgentDetection.Block, FORWARD)) {
builder.face(NORTH)
player.say("North")
} else {
agent.teleport(pos(0, 0, 0), SOUTH)
if (agent.detect(AgentDetection.Block, FORWARD)) {
builder.face(SOUTH)
player.say("South")
} else {
player.say("No block found")
}
}
}
}
})
0
-
Thank you for the feedback BJ CJ
0
Please sign in to leave a comment.
Comments
1 comment