Using AvatarShape components in sdk7 sets the initial position properly, but if you go outside the view of the scene and come back, the npc avatar is rendered on the ground and not back in its original position.
Operating system:
NA
if SDK, CLI Version:
Latest SDk
If SDK, Node version:
NA
Local or deployed:
Both local and in production
Code snippet:
import as npc from 'dcl-npc-toolkit' import { InputAction, MeshCollider, MeshRenderer, Transform, engine, pointerEventsSystem } from '@dcl/sdk/ecs' import { Vector3 } from '@dcl/sdk/math' export from '@dcl/sdk' export function main(){ let ent = npc.create({position: Vector3.create(8,5,8)},{ type: npc.NPCType.AVATAR, onActivate:()=>{} }) let box = engine.addEntity() MeshRenderer.setBox(box) MeshCollider.setBox(box) Transform.create(box, {position: Vector3.create(4,1,8)}) pointerEventsSystem.onPointerDown({ entity:box, opts:{hoverText: "Delete", button: InputAction.IA_POINTER} }, ()=>{ engine.removeEntity(ent) }) }
Severity:
SEV-4 | Minor issue
Description:
Using AvatarShape components in sdk7 sets the initial position properly, but if you go outside the view of the scene and come back, the npc avatar is rendered on the ground and not back in its original position.
Operating system:
NA
if SDK, CLI Version:
Latest SDk
If SDK, Node version:
NA
Local or deployed:
Both local and in production
Code snippet:
import as npc from 'dcl-npc-toolkit' import { InputAction, MeshCollider, MeshRenderer, Transform, engine, pointerEventsSystem } from '@dcl/sdk/ecs' import { Vector3 } from '@dcl/sdk/math' export from '@dcl/sdk' export function main(){ let ent = npc.create({position: Vector3.create(8,5,8)},{ type: npc.NPCType.AVATAR, onActivate:()=>{} }) let box = engine.addEntity() MeshRenderer.setBox(box) MeshCollider.setBox(box) Transform.create(box, {position: Vector3.create(4,1,8)}) pointerEventsSystem.onPointerDown({ entity:box, opts:{hoverText: "Delete", button: InputAction.IA_POINTER} }, ()=>{ engine.removeEntity(ent) }) }
Steps to reproduce:
Check the snippet/video below:
Ticket number: