Hi im trying to make a sphere that has an orbit around the player, but the spheres position on the orbit is whereever its closest to the cursor.
I have a spline as the orbit around the player character, thats where the orbit reference is from.
I always get this error message :
The Project is the Basic Top Down Template, i only changed the movement to be WASD, and added a Dash.
If there is some Information missing, just ask.
Thank you in advance
Creating a variable does nothing on its own - it is not associated with any object. Imagine if you had 5 orbits and 5 drones - how is the engine supposed to know who is who…
You need to tell the orbit reference which orbit actor you mean. Are both the drone and the orbit in the Level Blueprint? If that’s the case, use the Instanced Editable reference to point it at the actor you need:
When i created the Variable, the Variable type is set to variable type to the spline object. Does that not tell the orbit reference which orbit i mean?
When i created the Variable, the
Variable type is set to variable type
to the spline object. Does that not
tell the orbit reference which orbit i
mean?
Nope, sadly - what if you had 40 orbits? It’s a reference - it’s in the name, it has to refer to an instance of an orbit actor. Which orbit actor? Where is the actor?
If you create a string variable but forget to type in the text - what do you have? Nothing. Same with your Orbit variable - it’s null - hence the error accessed none.
And neither are in the Level
Blueprint.
So how do you spawn them, how do they get into the game? You flagged it as Instance Editable - so how do you edit that instance?
For dynamically spawned actors, you’d normally do something along the lines of:
So we have 3 elements here:
the player
the drone
the orbit
Sounds cool! But how do they come into play? They do not know about one another, right? What’s the relation? What should the relation be?
Perhaps the player owns the orbit and the drone follows it (and the cursor). Is that the scenario?
The Idea was that the Player owns the orbit and the drone is always on that orbit. They should all spawn together. The plan is that the drone is the players starting weapon.
the Player has the spline (rotation should be flagged as Absolute)
the CAC creates the Drone actor (so you can replace it with another drone at a whim)
That’s what I understood, but you may have other gameplay plans so it may not be perfect.
I posted this recently:
Perhaps there’s something in there you can leverage. But you may have it covered, ofc. (seeing how your spline is already a neat circle unlike the monstrosity I’ve cobbled together)
They are all in the game from the start. So far im just trying how things work, so i just placed them in the world together, if that helps. Is that what you need to get this into working order or am i missing something?
Thank you for going through this with me by the way
so i just placed them in the world
together, if that helps.
So they are in the level (I said level blueprint - so that must have been confusing, my bad!). In that case you should be able to select the drone and choose which orbit actor it’s suppose to be using as in the green screenshot for above. But that’d still need connecting to the player…
Anyhow, if all three elements belong together, it’d would much simpler to ensure the player owns them from the get go, as below.