AR Coffee Caravan Project - Need help with animating of features or meshs (very lost)

Hi all, long time reader, first time poster

Im currently completing a unit at uni which is a replacement for a graphics unit (im an engineering student so app and unreal engine is way out of my scope), and for my final i must make a deployable AR app, with the idea revolving around a covid safe coffee caravan, i have produced my models in solid works and have gotten the app to deploy, im able to place my models within the scene when tapping on the screen of my phone.

But now i want to be able to go beyond this, my first mission is to be able to tap on the rear door of the van(after already placing the van in ar), having tapped the door i wish for it to open allowing the user to walk in (this is to be all 1:1 scale like a pre product demo or template).

I understand that to do this i must make up a “hit” blueprint casting on the door, but this is where my knowledge runs out, ive tried a few ideas that I thought were logical but they have all failed. Ive also scoured the forum for hopes of finding someone doing something similar in ar but to no demise. If anyone has any idea or could point in the right direction it would be much appreciated. Im enjoying this while unreal experience and wish to continue learning.

Cheers all

Hi

I personally understand your struggles, I started off the same way you did years ago.

I create a simple blueprint graph to visualize an example on how to tackle the raycasting from touchscreen to an actor, and then have that actor call a function.
( node graph: TouchScreenANimation posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4 )

So what I do here:

  • I get an Input Event, which returns me a location (in the form of a Vector3, but it is in fact a Vector2 representing the screen position of your touch input).
  • I then Deproject that location to world, so I know where the touch happened in the Worldspace of my scene.
  • I then do a linetrace, from the position i touched the screen, in the direction away from my screen with a maximum distance of Max Hit Distance. (for convenience I ignored the player pawn so the hit is not blocked on the way)
  • From the hit result i get the actor and I cast it to the actor type that has an animation. (So this could be your door), and call a function in that actor that will handle the rest for itself.

note that you could also implement this logic in your pawn, or anywhere else. This actor will need to be in the scene, and will need to have Inputevents enabled.
Hope this might help you a bit.

wow, im going over this now trying to logically understand how this works, but you say that i must place within an pawn or else where within the scene, which is where i begin to get confused as, (excuse my little knowledge ive only been using the unreal ar template) when creating a “placeable” I have only been able to get meshes to place, and only one mesh, so i have been placing a fully converted SOLID WORKS model as my mesh, being that its a mesh already within the “BP_Placable” blueprint I think this might be my main issue. making blue prints for blueprints, and so forth.

Is it possible to create a scene and then use it in the same way you would a mesh?

I’m not sure if I can follow with what you say, so I’ll just try and give things a bit more context.

When I say place it within your pawn, I mean you should make a blueprint that inherits from the pawn you use for your demo, this will probably be the default pawn within the AR template.
If you’re unfamiliar with the use of pawns and creating blueprints, try following some tutorials, you don’t have to get into AR immediately, the basics are the same for any platform.

also try to get a grip of the framework behind a game before you get started, this might help you a lot when it comes to understanding how things happen in Unreal.
( Gameplay Framework | Unreal Engine Documentation )

*Understanding the framework, and understanding the basics of blueprints will highly increase your ability to find solutions for your own problems through searching on the forum, YouTube or other answer pages, as you will learn the correct keywords you are looking for. *

As for your CAD model, everything that is just going to be “static” in your scene, you can place within a StaticMeshActor. This is a blueprint class that inherits from Actor, and has a *StaticMeshComponent *in it. (this is the kind of actor you spawn when you drag a mesh from your content browser into the scene.

For actors you want to do stuff, or add logic (for example the “Play My Animation” function I made in the example), you create new blueprints.

The only reason to place all your meshes in a blueprint together might be to be able to have functionality that applies to everything, or to keep an overview. There’s not really a need for it in your case.

Must these components be in the permanent scene? (the view port where you can drag you models on to) or can they be added to BP_placeable (as this touch to place van is a key component of the assignment)

you could keep everything in the BP_placeable and have the components interact aswell, you could then make for example a custom InteractableActorComponent, (blueprint inherriting from ActorComponent) that has a function interact, and instead of getting the hit actor you’d get the hit component and cast it to that class and call the interact function.