How to apply animation to a large number of static mesh actors in a single blueprint? UE4 - unreal-engine4

I'm working on a project in Unreal Engine 4 where I receive all the static meshes and objects from the designer classified and named correctly, for example she sends me a TV Unit and I want to find all the cabinets in this TV unit and apply the open and close animation to them.
What I tried to do so far is that I was able to detect all the cabinet doors in the TV unit in the level blueprint, based on the names of objects I received, which I already know is a bad idea but bear with me just for the sake of debugging, and I tried to apply the animation when that specific object is overlapped.
The problem is I can't seem to find a way to make the overlap event to work on all of these objects in the foreachloop, how can I attach the event to all of these object? and what is the best practice for something like this?
My level bluprint

Your question is not clear but here it goes:
Remember! A for loop will always bind the event to all elements in the array but if you take the element from the loop and use it in your event only the last one will be used.
Also I did not understand how can you play an animation on a static mesh , you will need skeletal meshes.
Please follow up to my answer , lets fix this . thanks.

Related

How to modify behaviour of a VR controller's pointer

My university colleagues and I are trying to develop a Virtual Reality project for university where we use an Oculus headset and create a scene with a mouse where you can select and click and drag different objects in the scene. You are supposed to be stationary and move one of the controllers as if it was a mouse. However, we want to modify the behaviour of the controller to better fit the 3D environment. When an object is not selected, we want to interpolate the depth of the cursor according to the interpolation of the nearest objects. There is a paper that we were shown in class that we are supposed to drag inspiration from, and it achieved this kind of behaviour of the cursor with a normal mouse but I can't seem to find any information on how they did it. Our final goal would be to compare both ways of managing the scene and assess which one is better. We are using Unity with VRTK as suggested by our professor, but we and can't really seem to be able to access the mouse's file on how it moves or its behaviour, and we are kind of lost on where to go. Could someone help with this?
Here is the paper where they talk about it:
https://dl.acm.org/doi/pdf/10.1145/3491102.3501884
We so far have tried creating a simple scene and adding objects with different behaviours as well as a controller instance, but we seem to only be able to modify the events of the mouse and not its specific behaviour.
Kind regards and thanks

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 create Spell Indicator Combat

I'm trying to do a League of Legends style combat. I have some ways that I have thought about doing it. I could use a range of vector 3's and say that if the enemy is in between those then the ability would hit. I could also use a collider that is a child to the player.
Both of these ways seem okay but I'm sure there is a more effective way.
This asset pack actually seems quite on point to what I'm attempting if anyone needs reference.
https://assetstore.unity.com/packages/tools/particles-effects/status-indicators-88156

Vuforia Unity - Tracking simple 3D shapes

Currently, I know that Vuforia can track objects that are scanned in the targets database. This means that if I wanted to recognize many objects, I have to scan each of them and upload them into the database.
Here’s what I want to create. I want to create an app using Unity that can recognize and track simple shapes (such as a rectangular box or a spherical ball) disregarding the size. For example, the app should be able to recognize a small Kleenex box as well as a big shipping box.
Is it possible to recognize these shapes with minimal object targets (e.g. recognize all rectangular objects with one object target)? If so, how can I set up vuforia to do so? I understand that this question may be confusing to understand, and I will do my best to elaborate more clearly. Thanks so much!

Iphone Game Develoment - Need design guidance

I have started programming a game for the iphone and as all beginners I feel like I am shooting in the dark. I just want to run my design and how my "graphics engine" works by you to see if it is anything close to standard design or good practise. Let me explain how it works:
For simplification reasons lets just say I have the following 3 classes:
LevelView: inherits from UIViewController and is a view with 10 buttons for each level of the game. Clicking a button creates a new GameViewController object (using initWithLevel) and instantiates it with an integer ( 1-10) according to the level the player chose.
GameViewController: inherits from UIViewController and has the initWithLevel(int) method and a big switch statement which performs the level setup according to the int that was passed. So it instantiates two types of objects (robots and planets) in various numbers according to each level. Each object it creates is inserted into an array belonging to a singleton. Then at the end it will start the gameloop which is another method in this class.
GameView: inherits from UIView and is where everything is drawn ( has a drawRect method) and where the touches Began,Moved and Ended methods are. What will happen for every gameLoop is that this will pull all objects from the global array (the array in the singleton) and according to what object it is it will draw the correct image at the correct location. ( location of robots and planets is stored within their respective objects as variables)
In the touches Began,Moved,Ended methods according to what the user does the relevant objects are pulled back from the Singleton array and their position/ability is updated. Therefore the next time the loop runs and they are drawn again the draw method wil update their location or behaviour.
Does this sound about right at this point? Should I be instantiating a GameViewController object to start the level? Should the gameLoop be in the GameViewController or should it be in the GameView. I have added the GameView onto the GameViewController in InterfaceBuilder It will draw the initial objects but I am not sure how to update them going forward. How do I call the drawRect method to update everything?
Anyways, sorry for the extremely long post. I am not looking for a specific answer just a review from someone more experienced in this to tell me:
1) yes you are going in the right direction design wise
2) no you need to rethink a few things
Thanks for your help
Stav
I would really really really recommend using a good game framework like Cocos2d, rather than rolling it all your own.
It's very fast and easy to get rolling with it, and a lot of top games were made with it.
It even has handling for "levels" like you are trying to do.
I downloaded it, and had my first test app up and running in 24 minutes!
Check it out at:
http://www.cocos2d-iphone.org/
I agree on the Cocos2d. On the other hand if you are interested in how the graphics work, start learning OpenGL ES, it's tough to learn but once you know it you aren't as limited as before by using frameworks that do all the work.
On your other question, the design. Apps are built on the MVC model. Depending on the scale of the app, you could put the game loop(logic) in the controller class or for a larger project (and a better design) you should separate the 2 in my opinion.