Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JamminGames

Pages: [1]
1
TNet 3 Support / Re: 3rd Person Camera setup help
« on: June 12, 2013, 03:18:53 AM »
thank you, TNObject.Find is extremely useful.
i was just going about solving the problem in a silly way. It's working fine now I appreciate pointing me in the right direction :)

2
TNet 3 Support / Re: 3rd Person Camera setup help
« on: June 05, 2013, 01:53:34 AM »
like, to clarifiy, in my createTarget(Transform tar) {

}

script i print out what tar is, and in the editor version this works fine, in the build version, if i open up my console and check, it does indeed print out GamePlayer(clone) as something that exists... but it just doenst seem to access it properly

3
TNet 3 Support / Re: 3rd Person Camera setup help
« on: June 05, 2013, 01:43:42 AM »
it's not so much an issue of accessing the camera script, i can either grab a get component reference, or make it a static and access its instance that way. the issue is the fact that the target is supposed to be passed by the player that has just been created, and in the player class it checks if it owns itself, and if it does, it passes its transform to the camera.

this works for first player but not further.

Static class reference, in my understanding, doesn't change the issue of my problem, it simply removes the need for storing a local reference and using the awake() to get its component.
my issue lies more in getting a reference to the player of that client.

i understand that player ID's are unique and in the TNManager script there is a list of all players... could i use that information to access the gameObject of that player and then use its transform.position ?

4
TNet 3 Support / how to extend / override create functions?
« on: June 04, 2013, 12:25:44 AM »
basically what i'm trying to do is make a function that passes through  2 things,
creating a projectile, and the playerID that created it.

i'm a total noob to network code so my understanding of the theory is probably off. is this how i should be going about implementing weapon firing over a network? I want to send a message when a player is shooting, and pass through what to instantiate client side, and where to instantiate it from.

5
TNet 3 Support / 3rd Person Camera setup help
« on: June 04, 2013, 12:19:11 AM »
So moving from single player to networked, i'm having some issues (probably my own stupidity) setting up my camera follow script.
Here's how i'm trying to implement it :

 the game scene client side has a camera that exists on level load. my follow script is attached but disabled by default.
when a player joins a match, in that player's start function i get a reference to that camera, and
if (tno.isMine)
{
    playerCam.enabled = true;
    playerCam.GetComponent<ThirdPersonCamera>().createTarget(transform);
}

in my camera script i have a function that takes in a transform and sets its target to look at as that transform and its position attempts to be behind that transform by <distanceOffset> units,

but passing it the transform when a player is created doesn't seem to work. I debug logged on the camera in its create target function what the transform is, and it seems to get a reference to the player object just fine with this method.

Any thoughts?
Should i be using a create for the camera when player is created? My thinking was that i would run into issues having to check for other cameras and delete them client side, since technically only 1 camera is needed per client.

thanks in advance for help :)

Pages: [1]