Hi @Ayesha_Irfan and welcome,
You can’t reparent an entity that doesn’t have an existing parent. Use addChild instead:
it is not working as well. Tried both of them
These are the solutions.
What is not working for you?
The entity is instantiated but is not added as a child in tempEntity. The tempEntity has no children
I’d put a breakpoint on the line to see what happens. Perhaps post a screenshots of that too. It should most definitely work, if the clonedEntity is not null / undefined.