Quantcast
Channel: Latest Questions by madfatcat
Browsing latest articles
Browse All 61 View Live

Cannot modify primitive's mesh

Hi All, I have a problem modifying cube's mesh. I simply put the cube primitive on the scene, then in the script I write: Mesh aMesh = GetComponent().sharedMesh; aMesh.vertices [0] = aMesh.vertices [1]...

View Article



Strange Circle collider 2D physics behaviour

Hi, I faced the strange 2D physics behaviour in my project. All I do is: click GameObject => Create Other => Sphere, then I remove Sphere Collider component in the inspector, add Circle Collider...

View Article

Recalculate normals for a bunch of vertices?

Is there an easy way to recalculate normals not for entire mesh, but only for a limited number of vertices? I have a procedurally generated mesh which and I add a dozen of vertices to this mesh each...

View Article

rigidbody2D.AddTorque() works differently on iOS, in editor and in web player

Hi All, I'm still facing very odd things in Unity's 2D physics. Today I discovered that rigidbody2D.AddTorque() adds much more torque in web player than in the unity editor or on iOS devices. Steps to...

View Article

How expensive Mesh.RecalculateNormals() is? Any way to recalculate only part?

I have a terrain that is generated procedurally. After each few frames I add 20 new vertices to my mesh. After setting new UVs and triangles, I perform RecalculateNormals(). The bad thing is that...

View Article


Weird bug: tapping on any GUI button leads to another 3D button handler...

I faced a strange bug: I have some buttons described in OnGUI function. I also have a 3d gameobject button with 2d collider which populates an event when pressed. I subscribed a handler...

View Article

setting transform physics2d issue

Hi, I faced a strange 2D physics behavior when setting object's transform. This code influence physics simulation for some reason: go.transform.position = go.transform.position; The objects go down...

View Article

2D physics "hot start"

Hey all, I'm placing 60 physics2d dynamic objects randomly on the screen and I'd like them to take the state of rest before the game starts. What I do is put a big sprite and simulation is done behind...

View Article


Photon, how to get number of all players on the server?

It's pretty strange, but I didn't find any info on that. I need to know how many CCUs there are on the server, or at least how many rooms. I need this info for skill-based matchmaking. The less players...

View Article


Strange bug in Unity 5 web build

A piece of code is simply not performed in my game. After upgrading to Unity 5 I noticed that the wheels of my car disappeared. Wheel class creates a looped chain of physics 2d circles to imitate soft...

View Article

Web player problem - The content was stopped because a fatal content error...

After upgrading Unity to 5.0.0 or 5.0.1 (not sure when exactly the bug appeared), I get web player crash with error message "The content was stopped because a fatal content error has been detected"....

View Article

Texture2d.ReadPixels produces a vertically stretched texture on iPad

I'm trying to make a screenshot and use it for transitions. The code below works fine in Unity Editor and on iPhone6s, however, on iPad2 it produces vertically stretched sprite. The sprite on iPad...

View Article

Instance variables and this == null in event handler

I fire an event from a coroutine of class A and subscribe to that event an event handler in class B. After the event handler is invoked, I get an error when trying to access instance variables from it...

View Article


iOS app size is huge on devices while .ipa size is normal

There's a plenty of similar questions, however, my case is different: I make a release build in Unity editor, platform is universal in player settings, then I archive my game in xCode 7.3.1, resulting...

View Article

UNET Networking: where and when to initialize instantiated player on the client?

In my game, for every connected client, player object is instantiated automatically by NetworkManager. I'd like to perform some initialization stuff (tie up some functions to player events etc) on the...

View Article


2D Physics: Circle's velocity vector becomes parallel to collider's edge...

I'm trying to create a circle that will bounce continuously in closed room. I created a CircleCollider2D and Rigidbody2D for the circle, set gravity scale to 0, mass to 1, linear and angular drag to 0....

View Article

Weird rendering on Android: some materials become black, some sprites are...

I have a game which looks great on iOS and in editor. However, on Android device the following happens: 1. I have several 3d objects on scene which use materials with Legacy shaders/Diffuse with...

View Article


How to place UI over native iOS view?

I created a native iOS plugin which creates a new UIView and adds it to main window. My canvas with all UI elements is covered by this new UIView and I need the canvas to be in front of it. How to...

View Article

ContentSizeFitter to change the RectTransform size immediately

I have a text field with VerticalLayoutGroup and ContentSizeFitter attached. ContentSizeFitter adjusts the RectTransform according to my text amount correctly, but I need an immediate effect after...

View Article

Admob banner drops fps from 60 to 40

Yes I know that banners hurt performance in mobile games, but I'm confused with two things: 1. Another banner providers like Facebook audience network or Applovin don't have such effect. 2. FPS is...

View Article

Programmatically create another shape in the same PolygonCollider2D

Is there a way to create a PolygonCollider2D with few shapes from code?

View Article


Crash in PhysicsScene2D::UpdateJoints(float)

I make a 2D physics puzzle game for iOS. The game is live on App Store and I keep receiving a lot of crash reports in xCode. I cannot reproduce this crash and my question is: what will be my next steps...

View Article


CircleCollider2D vs PolygonCollider2D: which collision solving is less...

Say I have a gameobject with Rigidbody2D and X circle colliders. Other gameobject also has Rigidbody2D and PolygonCollider2D with 2X points. Which of two gameobjects is less expensive in terms of CPU...

View Article

Make an object with greater friction slide less when correcting objects...

2D Physics: I have 2 similar objects connected with DistanceJoint2D and lying on the ground. The only difference between objects is that one has no friction and the other one has max friction. When I...

View Article
Browsing latest articles
Browse All 61 View Live




Latest Images