Clone subobject/face without moving - copy

I've spent about 20 minutes searching for this to no avail. All I want to do is create a double sided face for a shop sign for example.
I create a face that sticks out from the building, and I obviously want it double-sided, so I want to simply clone the face and flip the normal.
I know I can do this holding shift and translating the face, but then I have to move it back. I know that you can do this for an object in the edit menu, just selecting clone object, but it doesn't seem to work for sub-objects (ie., faces).
Also, when I searched for how to make a face double-sided, most suggestions were to change the renderer settings to change the face culling, or to apply a double-sided material. But, neither of these methods actually create a new face, do they? For example if I were to export it to my OpenGL project, exporting it wouldn't create the extra face vertices, would it?
Thank you.
Edit: I've been thinking, I know there are many ways to achieve this, I just thought I could detach the face to its own object, clone it in its place, flip the normal, and then attach the two objects to the original again, but the workflow is supposed to be easy.
Thanks.

OK, I've been playing around a bit, and found out that you can
1: Select the face.
2: Click Detach.
3: Select Detach As Clone.
4: Select Detach As Element if you want it to stay in the same object.

Related

Instantiating Objects at Different Intervals Unity

I am trying to make a 3D jumping game where my character is standing still and the objects and background are moving towards him to make it seem like he is running. I have a bunch of models for buildings that I am instantiating using an empty game object that I use as a spawner. I want the buildings to spawn one after each other, so whenever one building has moved far enough and left enough space the next one should spawn. I first tried to do this with InvokeRepeating, but the buildings are different widths so it does not work well with a constant repeat rate. I then tried to put a collider on my spawner and spawn a building whenever the spawner collider is not colliding with anything, but it seems to just spawn buildings infinitely. Is there a way to fix this or a better way to do this?
There are many different ways of doing this.
The most straightforward is possibly to let each building spawn the next one, as I assume they each know how wide they are and thus when it's time for the next.
Well , first things first your problem is looking more like a design problem. I would recommend searching things like "procedural world building" , also object pooling. There is lots of examples of runner games that do what you describe.
You can check the palyer position to instantiate , you can create parts of the road as prefabs , make lots and lots of prefabs and instantiate them as you go etc. The question you asked is simply too wide to give an actual answer. So if you have any more spesific questions , it'll be nice to answer !

How to change a variable when touching a pen drawing?

I'm making a game in Scratch where if they touch something their HP goes down. I'm planning on making multiple of the sprite appear without having to use clones or make several of the same sprite so I'm using the pen extension to draw it. I'm running into a problem though. When I tell it to change the variable by touching the sprite, the pen copy doesn't count as it so it won't change it. How do you make the variable change when touching the pen?
The main reason I don't plan on using clones is due to Scratch's 300 clone limit. I intend on having more than 300 of the thing i'm making, which would go over Scratch's clone limit and why most people use the pen to get around that. The answer marked as accepted technically solves the problem until that point so I marked it as correct.
For the sake of providing a formal answer to this question, I'll just rehash the comments above.
A solution that worked ended up being to create an invisible (via the ghost effect) clone that goes over each pen drawing - each clone acting like a hitbox.

Tracking one marker at a time vuforia

I am creating a HoloLens application with Vuforia, and i have a total of 9 markers and associated GameObjects with each marker. I want my application to show only one object at a time: for example, I scan the first marker, show the first object; when i scan the second marker, i want the first object to disappear and only the second object to show, and so on.
I tried adding a script to each GameObject that would destroy the GameObjects in the scene, but that did not work.
I have very little knowledge with C# so please point me to specific code.
Thanks all!
In order to control the maximum number of targets to be detected at the same time you need to use Vuforia's hint:
Vuforia::setHint(Vuforia::HINT_MAX_SIMULTANEOUS_IMAGE_TARGETS, <desired number>);
This is what you asked - however, according to what you wrote in the comments this is not really what you need. If your want to use extended tracking for other targets, it means they have to be detected too. So, what you really need is - once you have a target, to know if it is extended right now or not, and act accordingly.
This is done via:
if ( result.getStatus() == Vuforia::TrackableResult::EXTENDED_TRACKED )
This is an option in the Vuforia configuration.
Select your scene's ARCamera asset
Click "Open Vuforia Configuration"
Change "Max Simultaneous Tracked Images" to 1.
I saw that you mentioned this doesn't work with Extended Tracking. I haven't noticed this behavior myself, but if needed you can manually toggle the active states of the objects with GameObject.SetActive().

Scratch Cloning duplications

I am using scratch. I am cloning sprites and I am making a minecraft type game where I use many clones of one block to make the workload easier. I keep the original sprite hidden, and hide clones when I want to destroy them. I am trying to create new clones by moving the original sprite to the location where I want the clone, cloning the sprite, and then hiding the sprite and showing the clone. But, it appears as if the code for placing new sprites squares the number of clones placed and brings all of them to the character. I am new to this community and just began learning scratch. If there is a way to show the scratch code I would be happy to. Thanks.
What I think you'll find is that the code is calling for 'the sprite' as in the original and all clones of itself to move to the center, as the code runs for each instance (clone) of the sprite, hence causing it to replicate itself for every existing instance of the sprite.
What you would probably have to do is have an external script within the scene, or another sprite that has no clones, call the sprite in order to clone it, as I am fairly sure that scene behaviours can facilitate cloning of other sprites. From there, I would have it set some sort of global variable to the co-ordinates you want it to spawn at, and add a script for the sprite that makes it move to the co-ordinates specified by those variables when it is created.
Since you linked your project, I'll see if I can create a remix for it that fixes your problem tomorrow if the problem is still there.
Scratch has a clone limit of around ~ 301.
When you want to delete a clone, I suggest using the 'delete clone' block. If you think the screen needs to display more than 300 clones, you may have to use a method called stamping, where you store every x position on one list, every y position on another list, then render every position using a custom block. how to make it | example of the code
If you could screenshot your code, I could help debug it. I won steal it, so don't worry. And in case you're wondering, I've been been on Scratch for two years.

Best way to create different zones in Unity?

this is my demo lvl, made in blender:
think of it as two prallel walls,, the player can walk "through" them, exiting and entering the tunnel at any point
what i want is, to have a flag on the player,.. player inside the tunnel? = true.. outside = false. and the flag is updated at all times
so i had few solutions in mind .. i'll list them .. im a beginner, and i think there has to be a better way than what i have in mind . so bear with me
1- ray casting... have multiple nodes scattered across the tunnel, especially at corners.. if the player can raycast the nearest node, without the ray hitting the wall first.. then he is inside.. ..
well, this may have many problems.. no need to list them all :D
2- trigger zones.. have huge cube meshes around the tunnel. once the player leaves the zone mesh.. he is flagged outside..
great, except that it wont be accurate, as the wall is curvy as hell :D . .
3- draw a plane between the tunnel walls.. as in floor.. if the player is ontop of that specific plane. then he is inside the tunnel
thing is, i dont plan to make a floor.. but if i have to. then be it
4- draw a train of low resolution cubes , along and inside the walls.. and make them act as triggors.. so each time the player crosses the wall, he will pass through them, and they will trigger.. i might have to have two parallel trains at each side.. to figure out, whether the player is actually leaving the tunnel, or entering it
i know its a very basic question, but i think i can do better than the previous solutions i offered :(
thanks
You could use the solution 2, the triggers can overlap and have different shapes (box, sphere). This way you can get a more accurate tunnel information.
Aways try to avoid mesh colliders due performance issues.
Just in case:
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter.html
http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerExit.html