Hi there,
i'm having some little problem in picking an item from a collection.
this is a part of the code:
it look like the
works only for the lastest item of the collection.
what am i missing?
any help would be welcome =)
cheers,
jTassinari
i'm having some little problem in picking an item from a collection.
this is a part of the code:
;(BEFORE THE LOOP) Type Objs Field IDs End Type s = 20 d.Objs = New Objs For h = 0 To 2 d\IDs = CopyEntity (MyCube) PositionEntity d\IDs, Rand(-s, s), 2, Rand(-s, s) RotateEntity d\IDs, Rand(-2*s, 2*s), Rand(-2*s, 2*s), Rand(-2*s, 2*s) EntityColor d\IDs, Rand(90, 255), Rand(90, 255), Rand(90, 255) NameEntity d\IDs, "MC." + h EntityPickMode d\IDs ,2 ,True Next ; IN THE LOOP If MouseHit(1) Then CameraPick(Cam,Mx#,My#) e = PickedEntity() End If For p.Objs = Each Objs PName$ = EntityName(p\IDS) If e <> 0 Then EName$ = EntityName(e) If PName$ = EName$ Then ObjX# = EntityX(p\IDs) ObjY# = EntityY(p\IDs) ObjZ# = EntityZ(p\IDs) PositionEntity TxtrFrame, ObjX#, ObjY#, ObjZ# ShowEntity TxtrFrame PointEntity TxtrFrame, Cam frm=MilliSecs()/60 Mod 23 EntityTexture TxtrFrame, Explosion, frm End If End If Next
it look like the
If PName$ = EName$ Then ObjX# = EntityX(p\IDs) ObjY# = EntityY(p\IDs) ObjZ# = EntityZ(p\IDs) PositionEntity TxtrFrame, ObjX#, ObjY#, ObjZ# ShowEntity TxtrFrame PointEntity TxtrFrame, Cam frm=MilliSecs()/60 Mod 23 EntityTexture TxtrFrame, Explosion, frm End If
works only for the lastest item of the collection.
what am i missing?
any help would be welcome =)
cheers,
jTassinari