New answers tagged

0

Instead of showing you code, I will just outline an abstract way to perform AABB (axis aligned bounding box) vs AABB collision detection, that you can translate to any language. It may require some changing of how you store your character/tile data. First, construct your AABB (player & tile): cornersA = vec2[4]; halfwith = player.width/2; halfheight = ...


0

Find the origin of the player, like a circle in the center say 0.0 is the origin of the circle. With that your character is colliding and stopping within the collided region which is (0.0) of the source of the player. If that character is a circle then its outer radius shouldn't be hard to calculate, as you can get it with (x,y) using radius. What you have ...


2

Normally you want to initialize default values of your member variables in the Constructor itself it will be the faster way since UE4 uses CDO, however if you want to get a reference/pointer to another component you shall do it in virtual void BeginPlay() because at the time your constructor is called the other component/actor/whatever object may not yet be ...


1

I'm going to answer my own question here, since I figured it out. A Player's input is passed into AddMovementInput, which then affects ControlInputVector. A MovementComponent then queries this ControlInputVector using GetPendingInputVector. It then uses the result of this to update/affect Acceleration. The various Phys functions within MovementComponent ...


0

If the visual position is needed by one set of systems and the logical position by another set of systems, then it might be a good idea to have a separate component for each. Have the Animation system and the Rendering system read the VisualPosition components. Have the game-mechanical systems read the LogicalPosition components. Have the Movement System ...


0

It sounds like you're dealing with foreshortening. When you look down at the z-axis along a diagonal, only part of the length of a z-pointing vector goes into climbing your screen. The other part goes into receding into the depth "behind" your screen. So a given worldspace distance along the x axis — which points perpendicular to your view — covers more on-...


1

A spline is a curve built from a number of conjoined polynomial equations. Higher order splines are splines built of higher order polynomials. Generally speaking the higher the order, the more fluid the curve (sort of), with linear splines being a series of straight lines. Here are some examples or different orders (from the Wikipedia page on Bézier curves, ...


0

in 2d horizon is X axis. for restriction you can simple put a restricting object or read borders of your camera.assume you have a minX and minY empty objects. so you will have: [SerializeField] private Transform minX; [SerializeField] private Transform maxX; void Update() { if (transform.position.x < minX.position.x) { transform.position = new ...


Top 50 recent answers are included