Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Can someone explain character rotation

Hi guys,

I have made a teleporter and when a player runs through it I want the player to rotate so that he's facing away from the teleporter he teleported to, no matter if he went face first, sideways or backwards into the first teleporter. I understand it's something with the player controller holding the rotation information, but I can't seem to get it right.

My graph is like this:

alt text

It seems pretty random (which ofc. it's not) what the player rotation is, when he "spawns" at the new location.

Do I have to add or substract some numbers to get rotation right or???

This answer addresses the same question, but I cannot get it to work replicate the result. https://answers.unrealengine.com/questions/105866/rotate-player-in-the-same-rotation-than-target.html

Product Version: Not Selected
teleport.png (199.1 kB)
more ▼

asked Jan 29 '15 at 02:15 PM in Blueprint Scripting

avatar image

61 9 10 18

avatar image MickD777 Jan 29 '15 at 02:25 PM

Have you tried simply like this ? : alt text

actorrot.png (42.3 kB)
avatar image KennethMundt Jan 29 '15 at 08:42 PM

But that is only player at index 0. That won't work in multiplayer, if I'm not mistaken.

avatar image simmania Jan 29 '15 at 02:29 PM

The player's rotation will be the SpawnLocation.yaw if you do it like this. So rotate the SpawnLocation such that the forward vector (red one) is pointing in the desired facing. The player will then always look in that direction when spawned there.

avatar image KennethMundt Jan 29 '15 at 08:48 PM

I'm not entirely sure how you'd structure that. Is it something like this:

alt text

teleport.png (29.6 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you want to do this in multiplayer, then you would want to let the teleporter send a request to the server to change the rotation. So if someone walks through the teleporter, you call your "teleport" function i guess.

I would make a custom event called "teleport" which is replicated to server. Give it a reference to the PlayerController or Character who activated the teleporter and let the Server set the rotation.

The server has ALL player controllers. he can work with a player controller that you give to him. The Player itself only has his own (0). So with this PlayerController that you gave the server to work with, you can now set the Actor Rotation of the Character and maybe the controll rotation of the Controller itself to a new rotation. The new rotation should be made like you tried in you last comment picture.

more ▼

answered Jan 29 '15 at 08:56 PM

avatar image

6.8k 333 185 470

avatar image KennethMundt Jan 29 '15 at 09:36 PM

Thank you for the explanation. I'll try to achieve that tomorrow. Going through the replication tutorials and finish them tomorrow as well. I'll let you know how it goes.

I reckon I have to change the setup slightly to make it work proporly in multiplayer (in addition to handle rotation).

avatar image KennethMundt Feb 03 '15 at 01:37 PM

Ohh yeah.. Times flies when spending 24/7 inside the engine. I haven't actually prioritised getting the rotation to work yet. So many things to learn.

Thank you for your time eXi. I apologise for not trying out your solution and getting back to you in time.

avatar image eXi Feb 03 '15 at 02:28 PM

(: No problem, take your time.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question