hi everybody!
i'm still struggling with the unity5 + AC update... The pathfinding issue I had seems to be somewhat resolved (still not as good as in the unity4 prototype), but now, since the most recent update I have problems with my NPCs as well.
the ants (which run through the set) are controlled by a simple custom playmaker AI, but I used the NPC script to have the spriteanimation / angles taken care of. Correct me if i'm wrong, but didn't the NPC script align the sprite to face the camera? At the moment it doesn't unfortunately.
(when i open a backup the NPC scripts have little enable/disable checkboxes, in my new project they haven't. the new one also autoadds a Paths script, the old one didn't.. is my install broken? the rest seems to work so far)
I've looked into the align to camera script, but this script needs a specific camera, and I need it to work with the mainCamera. Then I've used playmaker to align it, which worked, but screwed up the angle/sprites..
is this a bug, or do I need to change the NPC to work with the newest AC or something?
any thoughts? thanks!
Comments
The only change made to the core system due to Unity 5 was that Hotspot colliders need to be placed on the sprite child, but rotation should be unaffected.
NPC sprites should still face the camera: the sprite child, that is. The root object won't. You can test a 2D sprite in a 3D environment easily by running the 3D Demo with the 2D Demo's player prefab (Brain2D) present in the scene before you run it.
when i move my main character through the scene, the sprite child doesn't align to the camera - stands completly still...
does this work for you? thanks!
PS: the main character works as expected.
If so, PM me the prefab.
when i press play, the "front sprite" of Brain gets displayed on the NPC sprite, but the sprite child of brain doesn't align with the moving camera.. (means it doesn't rotate in 3d space to align to the camera)
Unity 5.1.1f1 AC 1.47b
it does work in the old project with an older AC.... maybe something changed for the VR camera or UFPS (or whatever its called) support? or maybe my update went south (but i have no errors, and the rest seems to work as expected...)?
as far i can tell the sprite of the main character does not align either, but since the camera is following closely this is not a big issue (at least in my case).....
Testing with the Brain2D Player prefab, which I've been doing in the 3D demo, should have identical behaviour, however. But this is the first time you've mentioned VR - is your game making use of that?
I've PMed a dropbox link to the modified brain2d as NPC to you quite some time ago.... didn't you recieve it?
I get the feeling we are talking about different things... I was talking about something like this:
https://www.dropbox.com/s/f2xwm69phq844ly/align_to_3dCam.gif?dl=0
I solved it with playmaker (still have the problem that the NPC script seems to stop working when i instantiate the gameobject... but this could be on my side, I'll have to investigate first...
I don't know why everything worked in my Unity4 prototype, though...
NPCs are updated through the StateHandler script, to maximise performance, so they need to be added to the script's internal record once instantiated. This occurs automatically if you use the "Object: Add or remove" Action, but if you do this manually - you'll have to run StateHandler's GatherObjects function.
thanks for the gatherobjects function! works like a charm