Comments (10)
Are you using SRP? This package works in all versions that aren't using SRP, and if you are then only in 2019.3.
from gizmos.
Oh ok i now changed the OnDrawGizmos function ( i forget that it was obviously not being called if it is run in the built version haha) to just Draw then calling it from the update method, it now works perfectly ! Thanks a lot from your work and your help :)
from gizmos.
Showing the script you're using could help
from gizmos.
Oh, my bad.
I just test it with example code from the readme file.
Doesn't work.*
using UnityEngine;
using Gizmos = Popcron.Gizmos;
public class GizmoDrawer : MonoBehaviour
{
public Material material = null;
private void Update()
{
//use custom material, if null it uses a default line material
Gizmos.Material = material;
//toggle gizmo drawing using the same key as in minecraft
if (Input.GetKeyDown(KeyCode.F3))
{
Gizmos.Enabled = !Gizmos.Enabled;
}
//draw a line from the position of the object, to world center
//with the color green, and dashed as well
Gizmos.Line(transform.position, Vector3.one, Color.green, true);
//draw a cube at the position of the object, with the correct rotation and scale
Gizmos.Cube(transform.position, transform.rotation, transform.lossyScale);
}
}`
from gizmos.
To be clear, does it show only in play mode, only in edit mode, or neither? @Kabum80
I just tested the example readme script and it worked.
from gizmos.
@Kabum80, if you resolved your issue, you could write about it here (what was the problem, how you solved it). It might help others with similar problems. ;)
from gizmos.
I might know what it was.
With current example it is impossible to render on both Scene and Game views at the same time. If your layout shows both Scene and Game views at the same time, example code will render only on one view - for me it is Scene view, but it can be changed if you will play with windows.
But if Game view is active only on Play (which means Scene view is inactive on Play), then everything works alright - example is rendered on both views when they're switched.
BTW, example code is now rendered only in Play mode. If you want to see Gizmos in Edit mode too, following code can be used (this will also render on both Scene and Game views at the same time:
[ExecuteInEditMode] // add this Attribute
public class GizmoDrawer : MonoBehaviour
...
void OnRenderObject() // use this instead of Update
...
ExecuteInEditMode
MonoBehaviour.OnRenderObject
from gizmos.
Hello, i have the same issue as @Kabum80 (but mine dont show at any moments) , so i tried to follow @RunninglVlan 's solution. But it does not works for me or i followed your idea wrong, but idk why since i tried to add ExecuteInEditMode
and i dont think i have multiple game views at the same time. My code is:
using Gizmos = Popcron.Gizmos; . . . Gizmos.Line(Vector3.one, n.worldPosition);
I also use unity 2019.2.3f1.
TIA
from gizmos.
No, i do not think I use SRP.At least i do not remember using it or ever heard of it. Looks weird.
As you can see here :https://imgur.com/a/bXMhF3l the white thing is drawn by lines (it does a weird effect bc i changes the z pos trough the line so i am sure at least a part is displayed,
But on the built version, it doesnt : https://imgur.com/a/yJpgfxQ
from gizmos.
The weird effect in game view is because your view is scaled down to below 1x, causing some pixels to not render because there's the resolution was reduced. As for the build, do you know if Gizmos.Enabled is set to true, and that the code for rendering is running?
from gizmos.
Related Issues (20)
- Gizmo for VR HOT 5
- gizmos get rendererd by one camera only HOT 3
- Add shape fill (Gizmos.DrawCube) HOT 1
- Some materials turns back to its original(pink) when project is reopened or sometime on scene reloading in Universal Rendering pipeline Unity 2019.3.0f6. HOT 2
- Not Rendering in Android Phone HOT 1
- Lines rendering towards camera. HOT 8
- Version control HOT 5
- [2018.4.23] Not working in Play Mode HOT 3
- is it possible to the gizmo to be attached to a parent ? HOT 1
- it requires .Net Framework 4.5,can it be used in ubuntu , for Linux HOT 1
- Conflict with Graphic.DrawMeshInstancedProcedural HOT 3
- Prevent Drawing Over Worldspace and Transparent UI HOT 8
- "Authentication failed" error caused every time I pressed to play HOT 4
- AR and URP
- Can i make line thick? HOT 1
- i am lost, cant use package
- Gizmos.DrawRay HOT 1
- Rendering issues with HDRP HOT 2
- GC Alloc HOT 4
- Duration as parameter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gizmos.