Hi!
I've got a problem when I want to delete an entity.
Function DELETE_ENTITY()
If KeyHit(57) Then
For mesh.meshinfo=Each meshinfo
If picked=mesh\mesh
FreeEntity mesh\mesh
EndIf
Next
EndIf
End Function
The DELETE_ENTITY function works but after I call an other function to pick an entity and aplly an alpha on it.
Function PICK_ENTITY()
If MouseDown(1) And mouseInView() Then
picked = CameraPick (camera, mxp, myp)
If picked
CameraProject camera, EntityX (picked, 1), EntityY (picked, 1), EntityZ (picked, 1)
PositionEntity Gizmo, EntityX(picked), EntityY(picked), EntityZ(picked)
EntityParent picked, 0
EndIf
EndIf
For mesh.meshinfo = Each meshinfo
If mesh\mesh=picked
EntityAlpha mesh\mesh, 0.8
Else
EntityAlpha mesh\mesh,1
EndIf
Next
End Function
I've got an error message!!!
In fact, it's in the next lines that there is a problem.
For mesh.meshinfo = Each meshinfo
If mesh\mesh=picked
EntityAlpha mesh\mesh, 0.8
Else
EntityAlpha mesh\mesh,1
EndIf
Next
I think that the program want to apply an alpha on an entity deleted and I don't know how to do
I've got a problem when I want to delete an entity.
Function DELETE_ENTITY()
If KeyHit(57) Then
For mesh.meshinfo=Each meshinfo
If picked=mesh\mesh
FreeEntity mesh\mesh
EndIf
Next
EndIf
End Function
The DELETE_ENTITY function works but after I call an other function to pick an entity and aplly an alpha on it.
Function PICK_ENTITY()
If MouseDown(1) And mouseInView() Then
picked = CameraPick (camera, mxp, myp)
If picked
CameraProject camera, EntityX (picked, 1), EntityY (picked, 1), EntityZ (picked, 1)
PositionEntity Gizmo, EntityX(picked), EntityY(picked), EntityZ(picked)
EntityParent picked, 0
EndIf
EndIf
For mesh.meshinfo = Each meshinfo
If mesh\mesh=picked
EntityAlpha mesh\mesh, 0.8
Else
EntityAlpha mesh\mesh,1
EndIf
Next
End Function
I've got an error message!!!
In fact, it's in the next lines that there is a problem.
For mesh.meshinfo = Each meshinfo
If mesh\mesh=picked
EntityAlpha mesh\mesh, 0.8
Else
EntityAlpha mesh\mesh,1
EndIf
Next
I think that the program want to apply an alpha on an entity deleted and I don't know how to do