Author Topic: crosshair and weapon  (Read 821 times)

Offline gamerfan

  • int
  • **
  • Posts: 97
    • View Profile
crosshair and weapon
« on: March 31, 2012, 11:57:46 am »
Hi,
I have added a cross hair  as object3d and attached to weapon model.But the problem is that the cross hair is not visible.I am just following the Car tutorial where how the wheels of the Car are attached so that when the car moves the automatically the wheels also also move.I did it the same way here as well.But it does not seem to be working.But when I add the crosshair to weapon like below,
Code: [Select]
weapon.addChild(crossHair);

cross hair is not visible.Any clues what I am doing wrong here.

Thanks in advance.
« Last Edit: March 31, 2012, 02:30:50 pm by gamerfan »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: crosshair and weapon
« Reply #1 on: April 01, 2012, 09:28:29 pm »
Check if your cross hair is actually visible (maybe you are looking at it from the side or at the backside of it or...). Then check it's location in object space to see if that matched object space of the weapon (more or less). Making something a child of an object does in no way meant that it appears in the same place. If the parent is located around 0,0,0 in object space but the child is located around 100,1000,10000 in objects space, they never appear on screen together even if the child inherits the transformations of the parent.