how to make an object move automatically Within a specified path - unity3d

I am a beginner with Unity 5.6 and game development in general.
I have a train and its rails in my scene. I need the train to start moving automatically on the rails (within a specified path) when the game starts. When it reaches the end of the path it should return to the start and keeps moving. I also want to control its speed. I've tried many things and searching for answers to make this and haven't succeeded yet.
How can I do this please? What kind of code do I have to write? Do I need to attach it to the train object?

Related

Unreal Engine 4.27 buoyancy system not working (4.26.2 big issues also)

I'm trying to create a ship simulator within Unreal Engine (4.27) I tried to use Water plugin as also its content to start from and shorten the time to get it working.
I created an empty game project loaded Water/Maps/WaterTestMap then added an istance of Water/Blueprints/BP_BuoyancyExample to simulation (above sea level) and started the simulation... it just sink like anything else. I tried to modify some Buoyancy data parameters but it just seems that no forces are applied to the body.
I tried again on 4.26.2, using water plugin contents, and it seems to work but if I try to create a floating cube BP that mimics BP_BuoyancyExample (in the same level as above) it sinks all the times… the only way to make it work is to use EditorCube as static mesh.
I cannot understand where’s the fault but it really sounds like a wonderful bug…

My unrealengine lags when placing actors for world generation

I want to make world generation sort of like minecraft with destructable environment, but even one layer of blocks makes my game lag a lot, so i would like to know if there is anyway i can reduce or prevent the lag. Or any alternative ways to creating world gen that doesn't lag that much.
My level blueprint that makes the world gen looks like this:
(I couldn't fit it in one screenshot but the print string is the same in both pictures)
The cube actor which is spawning currently has no code but since i want a destrucable environment it will have code latter.
I have attepted to use voxel instead but it says im missing a .dll file, which im not sure what to do about. Where in the computer should i put that file?
The image here is in danish, but it says that the program could not be started, because VCRUNTIME140_1.dll is missing on the computer. Try to reinstall the program to fix the problem.
Thanks for the help
The game lags after you spawn or only while spawning the objects? consider using code instead of blueprints, usually you have better performances.
Use hierarchical instanced static meshes instead actors!
More details: YouTube

How can i save and load Anchorpoints using Unity

Every time I make the Select gesture, a new instance of the Cube prefab is created and placed in the Room. I would like to save the position of all the instances for example every 10 seconds. Furthermore I would like to load the saved instances when the app restarts.
I created a C# skript attached to the MainCamera with the following Content that i found on the Unity manual site https://docs.unity3d.com/Manual/windowsholographic-persistence.html. I do not know if that is more or less the right way or if its completly the wrong idea. the content of the LoadSave skript
I am completly new to unity and mixedreality and would be very thankfull if someone could help me.

Unity default ThirdPersonController error

I've got a player spawning in the scene upon it's start. Using the standard assets, I've dragged the default ThirdPersonController.
However, when I run, although the player spawns correctly, this error comes along.
This is the default script from the standard assets (which I've made no change to).
The way I'm saving and loading the character is with two scripts: [GameMaster][3] and [GameSettings][4] (which are generated along with the player).
Please notice that the default camera that should follow the player is also not working. What am I missing?
Best,
Sporting

Positioning 3d objects for AR in Unity3d

I'm experimenting with an AR experience in Unity3D. I'd like to place models in my Unity scene and have them show up on top of real world objects using tango. I'm using tango's augmentedReality scene as a starting point.
Say there is a table in a room and I want a 3d cube to sit on top of it when it is in tangos view. Do I need to be using an .adf file to solve this problem or is there something else I should be looking into.
Is there some way to test an .adf file locally in my unity scene? This would be ideal to establish and debug the correct positions to place models in my scene.
Just trying to sort everything out.
If you want keep your virtual object's position persistent between different runs of the application, you will need a ADF file to relocalize. Unfortunately, there's no in-editor debug functions for ADF at the moment, so you will need to create a program to place the objects.
You could take a look of the Experiments/PersistentState example for reference. This example is not using AR, however, it's saving objects position with respect to your ADF's origin and keeping them persistently.