Home > other >  Unity with the X-ray testing and the transform component implementation open closed (without animati
Unity with the X-ray testing and the transform component implementation open closed (without animati

Time:09-28

Recently saw an interesting topic do not to come out, in unity with the X-ray testing and the transform component implementation open close the door, no animation c # programming,
Bosses will age

CodePudding user response:

Can describe in detail, so it is not difficult to, click with the X-ray testing location is a door, then the transform rotation in the way of change the door open don't know if this means

CodePudding user response:

1/f, residual reference both failed Pi response:
can you describe in detail, so it is not difficult to, click with the X-ray testing location is the door, then the transform rotation in the way of change the door open don't know if this means

Right, it is this meaning,

CodePudding user response:

1. The trigger to open the door operation (click? Point gate?
2. The door is set a tag
I this is a gate lock click the effect of the sluices gate open itself to click stop herself off to a certain Angle, logic design your own

If (Input. GetMouseButtonDown (0))
{
Vector3 touchPos=Input. MousePosition;
Camera curCamera=IBSimulatorPresenter. The Instance. The SceneManager. GetCurrentCamera ();
If (curCamera!=null)
{
TouchPos. Z=curCamera. NearClipPlane;
TouchPos=curCamera. ScreenToWorldPoint (touchPos);

Vector3 dir=touchPos - curCamera. The transform. The position;
RaycastHit [] hits=Physics. RaycastAll (curCamera. The transform. The position, dir);
For (int I=0; I & lt; Hits. Length; I++)
{

RaycastHit hit=hits [I];
If (hit.transform.Com pareTag (m_strClickArea_Tag))//tag set about if you click on the door is the door
{
//m_menGameObject. Transform. Rotate (new Vector3 (0, (float) menRotateSpeed * Time. DeltaTime, 0));
}


CodePudding user response:

The radiographic testing collision detection can be
  • Related