sceneview-android icon indicating copy to clipboard operation
sceneview-android copied to clipboard

Cant add custom instructions

Open Oromere opened this issue 2 years ago • 1 comments

Im trying to add custom instructions with this code:

val customInstructionNode: ViewNode = ViewNode()

fun displayCustomInstructionView(){
    customInstructionNode.apply {
        position = Float3(x = 0.0f, y = -0.75f, z = -2.0f)
        loadView(context, lifecycle, R.layout.custom_instruction_view)
    }

    customInstructionNode.onViewLoaded = { renderableInstance: RenderableInstance, view: View ->
        renderableInstance.apply {
            isShadowCaster = false
            isShadowReceiver = false
            renderPriority = 0
        }
    }

    if (scene.instructions.enabled){
        scene.instructions.infoNode = customInstructionNode
    }
}

I'm doing this after plane tracking is established and no other instruction is displayed, but the custom instructions are never visible. Through some debugging, I found out that the onArFrame function in Instructions is setting the infoNode to null directly after setting it.

Am I missing something, or is this a bug?

Oromere avatar Aug 30 '22 21:08 Oromere

Hi! This is probably an intended behavior for default instructions, however, we are open for suggestions and pull request.

grassydragon avatar Sep 01 '22 07:09 grassydragon

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 01 '22 05:12 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Dec 09 '22 05:12 github-actions[bot]