Похожие чаты

How should I move my character based on the camera

orientation? I've also been playing some Elden Ring and I like the left right movement where the character will walk in circles.

Vector3 direction = new Vector3(inputVector.x, 0, inputVector.y).normalized;

if (direction.magnitude >= 0.1f) {
// Calculate the move direction based on the camera's orientation
float targetAngle = Mathf.Atan2(direction.x, direction.z) * Mathf.Rad2Deg;
float moveSpeed = speed * Time.deltaTime;

Vector3 moveDir = Quaternion.Euler(0, targetAngle, 0) * Vector3.forward;
Vector3 velocity = moveDir * moveSpeed;

// Ensure we handle collisions with our existing logic
Vector3 finalMovement = ColllideAndSlide(velocity, transform.position, 0, false, velocity);
_rigidbody.MovePosition(transform.position + finalMovement);
}

3 ответов

13 просмотров

You will need a way to lock an enemy, then from there you want the intersection points of a circle of diameter 1 around your player and a circle of diameter distance(player, target) centered around the target. From there those two points mark your left and right unit vectors, that should give you a good approximation of elden ring's strafing around enemies

Snoop Christ-(Alex) Автор вопроса
Ludovic 'Archivist' Lagouardette
You will need a way to lock an enemy, then from th...

Btw I switch to cinemachine for the camera, I suppose I can just use that as a movement ref?

Snoop Christ (Alex)
Btw I switch to cinemachine for the camera, I supp...

Yeah, since this type of formula is just indexed on the camera, it basically changes nothing

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта