Welcome,
Guest
. Please
login
or
register
.
January 24, 2025, 10:04:19 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
check if object is mine
« previous
next »
Print
Pages: [
1
]
Author
Topic: check if object is mine (Read 2123 times)
sloopernine
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 47
check if object is mine
«
on:
July 07, 2013, 05:51:58 PM »
I know I can use tno.isMine to check the object the script is attached to. But is there a way to check if "target" object is mine?
using
UnityEngine
;
using
System.Collections
;
public
class
test
:
MonoBehaviour
{
public
Transform target
;
public
float
objPosX
;
public
float
objPosY
;
public
float
objPosZ
;
public
float
objAngleX
;
public
float
objAngleY
;
public
float
objAngleZ
;
// Use this for initialization.
void
Start
(
)
{
// Rotate object into position.
transform
.
Rotate
(
objAngleX, objAngleY, objAngleZ
)
;
}
// Update is called once per frame.
void
Update
(
)
{
transform
.
position
=
new
Vector3
(
target
.
position
.
x
, objPosY, target
.
position
.
z
-
objPosZ
)
;
}
}
«
Last Edit: July 07, 2013, 06:05:38 PM by sloopernine
»
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: check if object is mine
«
Reply #1 on:
July 07, 2013, 07:11:25 PM »
target.GetComponent<TNObject>().isMine
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
TNet 3 Support
»
check if object is mine