How do i easily clamp my cameras rotation when using transform.rotate()

I’m making a fps controller, and I’m trying to clamp my cameras x rotation. Here’s my code so far:

using System.Collections; using System.Collections.Generic; using UnityEngine;  public class Player : MonoBehaviour {     // Start is called before the first frame update      [SerializeField] Camera cam;     [SerializeField] float camSpeed;     [SerializeField] float walkSpeed;     [SerializeField] float jumpSpeed;      float yaw;     float camPitch;     Vector3 direction;     Vector3 worldDirection;      Rigidbody myrigbody;     void Start()     {         myrigbody = GetComponent<Rigidbody>();     }      // Update is called once per frame     void Update()     {         camPitch = -Input.GetAxis("Mouse Y") * camSpeed;         cam.transform.Rotate(new Vector3(camPitch, 0, 0));         yaw = (yaw + Input.GetAxis("Mouse X") * camSpeed) % 360f;          direction = new Vector3(Input.GetAxis("Horizontal") * walkSpeed, myrigbody.velocity.y, Input.GetAxis("Vertical") * walkSpeed);         worldDirection = transform.TransformVector(direction);          if(Input.GetKeyDown(KeyCode.Space))         {             myrigbody.AddForce(new Vector3(0, jumpSpeed, 0), ForceMode.Impulse);         }     }     private void FixedUpdate()     {         myrigbody.MoveRotation(Quaternion.Euler(0, yaw, 0));         myrigbody.velocity = worldDirection;     } } 

I know that I want to clamp my cameras X rotation within a range of -89 to 89, but no matter what I try I can’t figure out how to clamp the rotation while using cam.transform.Rotate(). I don’t think I can clamp camPitch, because it is reset every frame, and I can’t figure out a way to directly clamp the cameras rotation. The cameras rotation is not resetting, so if I could somehow clamp it it would work. Is this possible, or do I need to try a different method? How do i get this to clamp correctly?

Easily create LinkedIn bots and automate operations.

Hey all,

I want to share with you a new GitHub project. This is a NodeJS API wrapper for LinkedIn unofficial API.

This project helps developers building some cool LinkedIn bots/services.
All you need is a working LinkedIn account and some basic knowledge of Javascript/NodeJS/TypeScript

Those are the features my API provides (so far):
* Search for people, companies, and connections
* View profiles
* View sent and received invitations and send new invitations to any profile.
* Navigate…

Easily create LinkedIn bots and automate operations.

In Unity how do I easily snap modular building pieces to the grid without overlaps or gaps?

I’m new to Unity and purchased a set of modular building pieces from the asset store. I’m trying to arrange pieces of wall. The pieces are 5 x 5 x 0.5, so I’ve set my world grid size to 5 units and am using align to grid to make them line up nicely. I’m running into an issue when I try to make a corner. When I align the pieces to the grid, there is some gap and overlap, as seen in this picture:

enter image description here

I then tried to manually move the end piece inwards, which resulted in this:

enter image description here

That looks slightly better, but needed a manual adjustment so I don’t think doing this everywhere scales very well, and plus there is some kind of visual/lighting artifact where the pieces overlap (hard to see in the screenshot but very obvious when I move around in game mode). Then I tried resetting that end piece back to the grid and pushing the two side pieces inwards, which resulted in this:

enter image description here

This looks good and has no overlap, but required a bit of manual adjustment and brought the sides off of the grid.

Assuming a set of wall pieces that are 5x5x0.5, how can I configure my grid and snap settings so that everything fits together nicely?

Can you escape from Dimensional Shackles as easily as by polymorphing?

The intent of Dimensional Shackles (which block all kinds of teleportation or interplanar travel on their victim) is clearly to prevent spellcasters from escaping.

But what happens if a Dimensional-Shackled spellcaster casts polymorph on himself (and then drops his concentration)? Is he then free from the Shackles and thus able to teleport away? Or are the Shackles somehow linked to him and will still be applied to him, still preventing him from teleporting/planeshifting/etc. until he actually escapes by succeeding on the DC 30 Strength check?

What does it cost to craft a Hell-knight plate with “Easily Worked” steel?

I have problems calculating the costs for a Hell-knight plate which is crafted based upon the Pathfinder Unchained Rules and using a special raw material (Easily Worked steel).

A Hell-knight plate costs 2000 gp off the shelf, the weight is 50 pounds.

The Unchained Rules state, that you have to “acquire raw materials whose value is equal to 1/4 the cost of the item or items you wish to craft”, in this case 500 gp.

The price per pound for Easily Worked steel is given in the table “Special Raw Material Costs”: 8 gp for use as trade good, or 4 gp for use in crafting.

Following the line of reasoning provided in another answer on this platform regarding the use of special raw materials, one can apply the 4 gp/pound as price for the acquisition of the needed special raw material.

As the armor weighs 50 pounds, this would result in (special) raw material costs of 200 gp. But this is much less than the costs for “regular” raw material (500 gp). I would assume, that using higher quality raw material would result in higher costs.

What is the correct way to calculate the costs using “Easily Worked” steel?

Font Awesome Cheat Sheet App to find the right icon easily

Hi Everyone,
This is my first post in this wonderful forums. I've created an app to search for the right icon (from Font Awesome, free version) in your web (or other platforms) design.
APP on google play:
https://play.google.com/store/apps/details?id=org.apache.cordova.FontAwesomeCS&hl=en

Please have a look, and let me your feedback, suggestions, ideas…etc. I'm also open if you have other ideas for other tools.

For whom those don't know Font Aswom, please visit:
https://fontawesome.com/…

Font Awesome Cheat Sheet App to find the right icon easily

What Other Softwares or Tools I Need to Run GSA Search Engine Ranker Easily?

Hi everyone! This is my first time in this forum and unfortunately I’ve got questions about GSA Search Engine Ranker. So, I’ve read that it can helps me to automate my work or project in term of link building. But later I know, using GSA SER will also need the other softwares an tools, for example the one to bypass repatcha, etc. So, since I am new to this software, what else I need to buy so I will be possible to provide my budget and help me building links without doing many things that will take more of my time?

At the moment while I am asking this, I have not been using the GSA SER that I’ve installed in my laptop since I have no idea how to start my link building project. I have seen some tutorials but I am ended up confusing. So, before I am getting any further about that, I hope there will be someone or two of you will help me to know which tools I will need to buy so I can prepare my money for them. I really need a help in this and I hope will get answers.

Before, since my goal is to build backlinks that can be indexed for my blog, I have listed some of the softwares and tools from this site which are:

  1. GSA Search Engine Ranker
  2. GSA Auto Website Submitter
  3. GSA Captcha Breaker
  4. GSA SEO Indexer
  5. Backlink’s Indexing Services

Are the above tools and softwares enough?