Author Topic: Starlink UI SK - Anything in there that would effect Physics?  (Read 5856 times)

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Hello!

I went through and replaced a main menu scene that was made up of just NGUI and some TNET code with the Menu Scene from the Starlink UI SK.  So now the Play buttons will just move into my Gameplay Scene.

Everything is working great so far except when I BUILD the project to a windows client, all of the physics collisions in GamePlay scene are all completely offset.  I'm just wondering if you can think of something in the Menu Scene that could affect the physics simulation somehow?  The collisions work perfectly in the editor but as soon as I build, they look to be offset to where they should be.  By offset, I mean that I have seen a bullet collide visually with a enemy but a DIFFERENT enemy off to one side is actually collided with.

Please let me know if you need any more information about what I have setup.

Thanks!
Scott

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #1 on: June 10, 2013, 11:18:48 PM »
Nope, nothing. Are you sure your game world is not being drawn by more than one camera?

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #2 on: June 11, 2013, 12:25:26 AM »
Hmmm well that did point me at a few things where the menu scene cameras were all culling the wrong layers.  But I am only seeing two Camera's in my gameplay scene: Main Camera and then my original UI Root (2D) -> Camera.

Is it weird that it works perfectly in the editor?

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #3 on: June 11, 2013, 10:15:19 AM »
Well I have confirmed that it's not really that the physics are offset, something is completely messed up with the collisions all over the place.

I reverted the changed I made bringing in the StarlinkUI Menu Scene and everything worked again.  I will go and recreate the Starlink UI menu screen with a very basic window setup and see if I can find what created this problem.

To me it does seem like it is a camera issue as that is definitely the biggest change from my old build but I still find it very weird that it works perfectly in the Editor and it's just broken in the BUILD version.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #4 on: June 11, 2013, 12:46:22 PM »
Well, the UI is just that -- a UI. I have a feeling your issue was related to layers and you may have missed something. You could always simply try to turn off the UI camera and see if it works like that. It'll bring you one step closer to what's wrong.

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #5 on: June 11, 2013, 01:17:20 PM »
Yeah for sure I agree.  I actually did try disabling a lot of the cameras one by one to see if something was there but could not figure out why a completely different scene with completely different cameras was getting affected....and only in the build version.  Have never seen this behaviour before.

I will also go over all the layers again on everything to see if something is out of place.

I'll keep digging and I thank you for your input!

Thanks again for the tools!

Scott

broknecho

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 33
    • View Profile
Re: Starlink UI SK - Anything in there that would effect Physics?
« Reply #6 on: June 17, 2013, 12:56:08 PM »
Well I think I figured this out.  Basically it was a wild goose chase in the wrong direction thinking it was due to me just changing the UI (and the associated scripts).

Basically what was happening is that some of collision information was getting sent over an RFC.  When inside the Unity editor, the TNObject.uid's were actually getting set correctly as new objects were spawned.  This is WITHOUT a server started.  But when I compiled, the TNObject.uid was not incremented thus leaving a uid of 0 for all objects.  So when I Sent a message to an object, it seemed to have picked the first one it found with a uid of 0.

Anyhow, it wasn't due to changing the UI but it was from a disconnect in the way I instantiated the server/channel before I switched over to StartlinkUI!

That was a fun one.  :P